Agent
The Agent, by default, logs in INFO
level. You can set the log level to DEBUG
to get more information from your logs.
Note: Debug mode is meant for debugging purposes only. Datadog recommends only enabling DEBUG
for a certain window of time as it increases the number of indexed logs. Set the log level back to INFO
when done.
To enable the Agent full debug mode:
Modify your local datadog.yaml
file. See Agent main configuration file for OS specific details.
Replace # log_level: INFO
with log_level: DEBUG
(remove #
to uncomment the line).
Restart the Datadog Agent. See Agent Commands for OS specific details.
Wait a few minutes to generate some logs. See Agent Log Files for OS specific details.
Modify your local datadog.conf
file. See Agent main configuration file for OS specific details.
Replace # log_level: INFO
with log_level: DEBUG
(remove #
to uncomment the line).
Restart the Datadog Agent. See Agent Commands for OS specific details.
Wait a few minutes to generate some logs. See Agent Log Files for OS specific details.
Containerized Agent
To enable debug mode for the container Agent, use DD_LOG_LEVEL=debug
when starting your Agent.
For Agent v6.19+ / v7.19+, set the Agent log level at runtime using:
agent config set log_level debug
If the trace-agent is in a dedicated container, you cannot change the log level for the trace-agent container at runtime like you can do for the agent container. A redeployment after setting dd_log_level
variable to debug
is still necessary for the dedicated trace-agent container.
When run in a container, the Agent cannot be restarted via service datadog-agent restart
(or similar) which causes the container to be killed by Docker. Use supervisor to restart a containerized Agent:
/opt/datadog-agent/bin/supervisorctl -c /etc/dd-agent/supervisor.conf restart all
The following commands enable debug logging, restart the Agent, wait 60 seconds, then send a flare, in that order:
sed -i '/\[Main\]/a LOG_LEVEL=DEBUG' /etc/dd-agent/datadog.conf
/opt/datadog-agent/bin/supervisorctl -c /etc/dd-agent/supervisor.conf restart all
sleep 60
/etc/init.d/datadog-agent flare <CASE_ID>
Debug logs can be disabled with:
sed -i '/LOG_LEVEL=DEBUG/d' /etc/dd-agent/datadog.conf
/opt/datadog-agent/bin/supervisorctl -c /etc/dd-agent/supervisor.conf restart all
Or the container can be restarted.
Agent log level
The following Agent log levels are available for log_level
or DD_LOG_LEVEL
:
Option | Critical logs | Error logs | Warn logs | Info logs | Debug logs | Trace logs |
---|
'OFF' | | | | | | |
'CRITICAL' | | | | | | |
'ERROR' | | | | | | |
'WARN' | | | | | | |
'INFO' | | | | | | |
'DEBUG' | | | | | | |
'TRACE' | | | | | | |
Note: When setting the log level to 'OFF'
in the configuration file quotes are mandatory to prevent the value for being improperly parsed. Quotes are optional for other log levels.
Further Reading
Additional helpful documentation, links, and articles: