Log levels & agent debug mode

Multiple logs levels are available to allow for easy debugging and to track agent usage and errors. By default the agent will log warnings and errors but if you are having problems with the agent not reporting certain metrics or with your plugins, you can enable debug mode which will log every action the agent takes.

Log levels

INFO 
This is the standard logging level and is enabled by default. This records standard informational output, such as when the agent started and when the checks are run. Error messages and warnings are also logged. 

DEBUG

Debug mode logs everything to help you when attempting to debug issues with the agent. All metrics and plugin outputs are stored in the collector logs when debug mode is enabled. This allows you to ensure that your plugins are returning the correct data to the agent. 

When you contact support, we will most likely ask for your debug logs.

ERROR

Only error messages are logged.

Enabling debug mode 

Browse to your agent config file

Linux
cd /etc/sd-agent/
macOS
cd /usr/local/etc/sd-agent/

Enable debug mode in the config file

Open the config file in a text editor such as nano:

nano -w config.cfg

Find the following line

# log_level: INFO

Change it to:

log_level: DEBUG

Save and exit (if you used nano, Ctrl + X then press Y).

Restart the agent

This will depend on how you installed the agent, but you can normally run:

Linux:
sudo /etc/init.d/sd-agent restart

or

sudo service sd-agent restart
macOS:
sudo launchctl unload /Library/LaunchDaemons/com.serverdensity.agent.plist
sudo launchctl load /Library/LaunchDaemons/com.serverdensity.agent.plist
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.