How to increase debug logging to investigate remote agent problems
Purpose
This knowledge base article is intended to help in troubleshooting agent problems by increasing the logged information on server and/or agent logs.
Solution
Option1: Debug server and agent (requires a server restart)
- Edit the <Bamboo-Install>/atlassian-bamboo/WEB-INF/classes/log4j.properties.
The debug classes can be added on demand in your log4j.properties file depending on what problem is being troubleshot:
Subject Classes to debug Agent Registration log4j.category.com.atlassian.bamboo.agent=DEBUG
log4j.category.com.atlassian.bamboo.v2.build.agent=DEBUG
log4j.category.com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl=DEBUG
Agent load log4j.category.org.apache.activemq=DEBUG
External process log4j.category.com.atlassian.utils.process=DEBUG
log4j.logger.com.atlassian.bamboo.executor=DEBUG
Git log4j.logger.com.atlassian.bamboo.plugins.git.GitRepository=DEBUG
Restart both server and agent (the above debugging classes will also take effect on agent logs after the restart)
Option2: Debug only the agent
If you cannot restart your server, you can enable the logging only on the agent side with the following steps:
- Stop your agent
- Copy the <Bamboo-Install>/atlassian-bamboo/WEB-INF/classes/log4j.properties (Bamboo server) to your <Agent_Home> directory
- Edit the log4j.properties based on debugging classes suggested in the table above
Configure your agent to load the log4j.properties file:
Uncomment the line following line on <bamboo-agent-home>/conf/wrapper.conf and add the absolute path to the log4j.properties file you just copied:#wrapper.java.additional.3=-Dlog4j.configuration=
It should look like this after the change:
wrapper.java.additional.3=-Dlog4j.configuration=<AGENT_HOME>/log4j.properties
- Restart the agent
For more info on how to increase log verbosity on remote agents:
Extra debugging: Investigating packet content
For deeper investigation on packet content, network traffic dumps between the agent and the server are helpful.
Please enable the network packet capturing on server side and reproduce the problem. Please refer to Capturing HTTP traffic using Wireshark or Fiddler for more details on how to capture the network packet.