Skip to end of metadata
Go to start of metadata
You are viewing documentation of TeamCity 6.5.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version.
Search

Table of Contents

TeamCity Server keeps a log of internal activities that can be examined to investigate an issue with the server behavior or get internal error details.

The logs are stored in plain text files in a disk directory on TeamCity server machine (usually <TeamCity Server home>\logs).
The files are appended with messages when TeamCity is running.

Enable Debug in Server Logs

Icon

In web UI Go to Administration | Server Configuration | Diagnostics tab and choose logging preset, view logs under Server Logs subsection.
If it is not possible to enable to enable debug logging mode from the TeamCity web UI, refer to Changing Logging Configuration section to learn how to adjust logging options manually.

In this section:

General Logging Description

TeamCity uses log4j library for the logging and its settings can be customized.

By default, log files are located under <TeamCity Server home>/logs directory.

The most important default log files are:

teamcity-server.log

General server log

teamcity-activities.log

Log of user-initiated and main build-related events

teamcity-vcs.log

Log of VCS-related activity

teamcity-notifications.log

Notificaitons-related log

teamcity-svn.log

(off by default) SVN integration log

teamcity-tfs.log

(off by default) TFS integration log

teamcity-starteam.log

(off by default) StarTeam integration log

teamcity-clearcase.log

(off by default) ClearCase integration log

teamcity-ldap.log

LDAP-related log

Other files can also be created on changing logging configuration.

Some of the files can have ".N" extensions - that are files with previous logging messages copied on main file rotation. See #maxBackupIndex for preserving more files.

Logging-related Diagnostics UI

Users with System Administrator role can view and download server logs right from TeamCity web UI under Administration | Server Configuration | Diagnostics tab, Server Logs subsection.


Also, users with System Administrator role can change active logging preset for the server logs for the server logs under Administration | Server Configuration | Diagnostics tab, Troubleshooting, Debug logging subsection. Choosing a preset will change logging configuration until the server is restarted.

The available presets are configured by the files available under <TeamCity Data Directory>/config/_logging directory with .xml extension. New files can be added into the directory and existing files can be modified (using .dist convention).

Changing Logging Configuration

By default TeamCity searches for log4j configuration in ../conf/teamcity-server-log4j.xml file (this resolves to <TeamCity Server home>/conf/teamcity-server-log4j.xml for TeamCity .exe and .tar.gz distributions when run from "bin"). If no such file is present, default log4j configuration is used.
The logs are saved to ../logs directory by default.

These values can be changed via corresponding "log4j.configuration" and "teamcity_logs" internal properties. e.g. log4j.configuration=file:../conf/teamcity-server-log4j.xml and teamcity_logs=../logs/

While TeamCity is running, logging configuration for the server can be switched to a logging preset.

If you want to fine-tune log4j configuration, you can edit teamcity-server-log4j.xml while the server is running - the logging configuration will be changed on the fly.

The logs are rotated by default. When The logs are rotated by default. When debug is enabled it makes sense to increase the number of rotating log files. While doing so please ensure there is sufficient free disk space available.

You can change the log4J configuration files while the server/agent is running. If it is possible (some log4j restrictions apply), the loggers will be reconfigured without process restart.

If it is not possible to enable debug logging mode from the TeamCity web UI, remove from the conf/teamcity-server-log4j.xml file all the lines containing following comment

<!-- DELETE THIS LINE FOR ENABLING DEBUG LOGGING -->

When debug is enabled it makes sense to increase the number of rotating log files. While doing so please ensure there is sufficient free disk space available.

You can change the log4J configuration files while the server/agent is running. If it is possible (some log4j restrictions apply), the loggers will be reconfigured without process restart.

Most useful settings of log4j configuration:
To change the minimum log level to save in the file, tweak "value" attribute of "priority" element:


To save more rolling files, tweak "value" attribute of "maxBackupIndex" element:

Reading Logs

Each message has a timestamp and level (ERROR, WARN, INFO, DEBUG).

e.g.:

[2010-11-19 23:22:35,657] INFO - s.buildServer.SERVER - Agent vmWin2k3-3 has been registered with id 19, not running a build 

ERROR means an operation failed and some data was lost or action not performed. Generally, there should be no ERRORs in the log.

WARNs generally means that an operation failed, but will be retried or the operation is considered not important. Some amount of WARNs is OK. But you can review log for such warnings to better understand what is going OK and what is not.

INFO is an informational message that just reports on the current activities.

DEBUG is only useful for issue investigation. e.g. to be analyzed by TeamCity developers.



See also:

Administrator's Guide: Viewing Build Agent Logs
Troubleshooting: Reporting Issues