TeamCity On-Premises 2022.10 Help

Viewing Build Agent Logs

To analyze agent-specific cases, there are internal log files saved by the TeamCity agent process into <TeamCity agent home>/logs directory on the agent machine.

When the agent is connected to TeamCity server, you can browse and download the agent logs in TeamCity web UI, on the Agent Logs tab for an agent.

If you need to customize the logging, see below.

Log Files

TeamCity uses Log4j 2.x for internal logging of events. The default build agent Log4j configuration file is <agent home>/conf/teamcity-agent-log4j2.xml.

See the comments in the Log4j configuration file for enabling the DEBUG mode. Build agent logs are placed into <agent home>/logs directory. Normally, you do not need to restart the agent for the updated logging configuration to be applied.

File name

Description

teamcity-agent.log

General build agent log

teamcity-build.log

stdout and stderr output of builds run by the agent

teamcity-vcs.log

VCS-related logging (for checkout mode "Automatically on agent")

upgrade.log

log of the build agent upgrade (logged by the upgrading process)

launcher.log

log of the agent's monitoring/launching process

wrapper.log

(only present when the agent is run as Windows service or by Java Service Wrapper) output of the process build agent launching process

Generic Debug Logging

To enable general debug logging on an agent, change the jetbrains.buildServer category logging priority in the <agent home>/conf/teamcity-agent-log4j2.xml file:

<Logger name="jetbrains.buildServer" level="DEBUG"> <AppenderRef ref="ROLL"/> </Logger>

If you're using TeamCity version < 2022.04 then the following replacement should be done in the <agent home>/conf/teamcity-agent-log4j.xml file:

<category name="jetbrains.buildServer"> <priority value="DEBUG"/> <appender-ref ref="ROLL"/> </category>

Then, see teamcity-agent.log* files.

VCS Debug Logging

To enable detailed VCS logging on an agent, change the VCS category logging priority in the <agent home>/conf/teamcity-agent-log4j2.xml file:

<Logger name="jetbrains.buildServer.VCS" level="DEBUG"> <AppenderRef ref="ROLL.VCS"/> </Logger>

If you're using TeamCity version < 2022.04 then the following replacement should be done in the <agent home>/conf/teamcity-agent-log4j.xml file:

<category name="jetbrains.buildServer.VCS"> <priority value="DEBUG"/> <appender-ref ref="ROLL.VCS"/> </category>

Then, see teamcity-vcs.log* files.

Specific Debug Logging

To get dump of the data sent from the agent to the server, enable an agent XML-RPC log, by uncommenting the line below in the <agent home>/conf/teamcity-agent-log4j2.xml file.

<Logger name="jetbrains.buildServer.XMLRPC" level="DEBUG"> <AppenderRef ref="ROLL.XMLRPC"/> </Logger>

If you're using TeamCity version < 2022.04 then the following replacement should be done in the <agent home>/conf/teamcity-agent-log4j.xml file.

<category name="jetbrains.buildServer.XMLRPC"> <priority value="DEBUG"/> <appender-ref ref="ROLL.XMLRPC"/> </category>

Then, see teamcity-xmlrpc.log.

Advanced Logging Configuration

You can configure location of the logs by altering the value of the teamcity_logs property (passed to JVM via -D option). You can also change the Log4j configuration file location by changing the value of the log4j2.configuration property. See the corresponding documentation section on how to pass the options.

For additional options on tweaking logging, refer to the TeamCity Server Logs page.

Last modified: 27 April 2022