Docker Swarm logging
This guide describes how you can set up log forwarding from your Docker Swarm environments to Apica Ascent. To forward logs from Docker Swarm to Apica Ascent, do the following.
Deploy fluent-bit container
Create the following files:
parsers.conf
fluent-bit.conf
Update the Apica Ascent host
and Authorization Header
in the file. The token can be obtained from Apica Ascent UI as described here.
docker-compose.fluent.yaml
Ensure that the Fluent Bit Docker Compose uses the parsers.conf
and fluent-bit.conf
which we prepared in the previous step.
Run the following command to get fluent-bit running in your Docker Swarm cluster.
Ensure that the fluent-bit container is running in the cluster.
Update services to add logging driver
Add the global logging configuration to your docker-compose files as shown below
Update the services in docker-compose files to add logging configuration and environment variables. The Namespace
and AppName
set in the service definition defines how the logs from the service are indexed in Apica Ascent.
Examples
If your default Docker Compose file looks like this:
After you’ve added the logging configuration, your Docker Compose file should look like this.
Run the following command to run the container.
Your Docker Swarm logs will now be ingested into Apica Ascent.
Last updated
Was this helpful?