Docker Container Logs
Collect the container logs in your Docker environment to troubleshoot issues with the applications running on it. Site24x7 provides easy access to collect your logs directly via the AppLog agent running on your Linux server. Learn more about log management with Site24x7.
Getting started
- Log in to your Site24x7 account.
- Download and install the Site24x7 Server Monitoring agent (Linux).
- Go to Admin > AppLogs > Log Profile and Add Log Profile.
If you do not have an agent installed in the host, but in the docker container, please use the command given below to install the Docker agent:
Log file path
Each application writes logs in different folders and files. By default, container logs will be sourced from the below-mentioned folder path. If you have logs in a different folder, you can mention it under the File Path to source them from that particular folder while creating a log profile.
Log pattern
This is the default log pattern defined by Site24x7 for parsing Docker Container logs based on the sample mentioned below.
Sample log
{\"log\":\"Starting image\",\"stream\":\"stdout\",\"time\":\"2019-06-04T11:29:54.295671087Z\"}
The above sample log can be separated into 4 fields, each of which will take its respective value from the original log, and then be uploaded to Site24x7.
Field name | Filed value |
Log | Starting image |
Stream | stdout |
Time | 2019-06-04T11:29:54 |
Container ID | 295671087Z |
Docker Container logs dashboard
AppLogs creates an exclusive dashboard for every Log Type, and shows a few widgets by default. Here's a list of the widgets available in the Docker Container logs dashboard:
- Container Stats
- Logs Trend