Coralogix provides a simple and seamless Gelf integration driver for your Docker logs. Ship your logs directly from your containers without having to install any SDK or agent, and get started in minutes.
This document includes cluster dependent URL’s. Each URL has a variable part (in Italic). Please match this part with a row entry within the following table. Copy the table row entry located under the column that matches the top level domain of your Coralogix account (.com, .in etc.). Replace the variable part of the URL with this entry.
Provide the following four variables:
- PRIVATE_KEY – A unique ID that represents your company. The private key can be found under ‘settings’->’ send your logs’. It is located in the upper left corner.
- COMPANY_ID – A unique number which represents your company. You can get your company id from the settings tab in the Coralogix dashboard.
- APP_NAME – The name of your environment, for example, a company named “SuperData” would probably insert the “SuperData” string parameter or if they want to debug their test environment they might insert the “SuperData–Test”.
- SUB_NAME – Your application probably has multiple components, for example, Backend servers, Middleware, Frontend servers etc. in order to help you examine the data you need, inserting the subsystem parameter is vital.
If you run your containers manually:
$ docker run -dit \
$ -e PRIVATE_KEY="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" \
$ -e COMPANY_ID=XXXX \
$ -e APP_NAME="simple-application" \
$ -e SUB_NAME="backend" \
$ --log-driver=gelf \
$ --log-opt gelf-address=udp://syslogserver.Cluster URL:20001 \
$ --log-opt env=PRIVATE_KEY,APP_NAME,SUB_NAME,COMPANY_ID \
$ alpine echo "Hello world!"
You can also use it with docker-compose.yml:
# Setup required parameters for Coralogix integration
# Setup logging driver
# Address of Coralogix syslog server
# Required parameters for request
Before using this integration, make sure you create a .env file with configurations or write them directly to the docker-compose.yml file.
Now you should have your docker logs streaming to Coalogix. Not seeing your logs in our LiveTail? Use our in-app chat for support.
You can try to deploy our example application: Source code.