YouTrack Standalone 7.0 Help

Configure Logging for YouTrack JAR

YouTrack logs are written in several files. The primary log file is youtrack.log. YouTrack logs are located in the <USER_HOME>/.youtrack/logs directory. Logs are collected using the Apache log4j logging library.

To modify logging levels in YouTrack, configure the logging properties in the youtrack-xxxxx.jar!/WEB-INF/lib/charisma-app-xxxx.jar!/jetbrains/charisma/main/log4j.xml file. Modifying logging properties in other files does not affect YouTrack logs.

If you don't want to edit the default system configuration, you can create your own custom log4j configuration. To use your custom log4j configuration, provide the full path to your log4j.xml file with the jetbrains.mps.webr.log4jPath Java start parameter. The JVM option for starting YouTrack with this start parameter looks something like this:

-Djetbrains.mps.webr.log4jPath=/users/YouTrack/conf/log4j.xml

Limit Logging Levels

You can customize the logging to print only events for a specific logging level. For example, you want to limit logging in the youtrack.log file to the WARN level.

To set the logging threshold:

  1. Open the log4j.xml file and locate the following code:

    <appender name="FILE" class="jetbrains.charisma.main.MultiplexingRollingFileAppender"> <param name="File" value="/logs/youtrack.log"></param> <param name="MaxFileSize" value="10Mb"></param> <param name="MaxBackupIndex" value="30"></param> <layout class="org.apache.log4j.PatternLayout"><param name="ConversionPattern" value="%d{DATE} %-5p [%-30.30c{1}] [%-50.50t] %\m%\n"></param> </layout> </appender>
  2. To limit logging to events with the WARN level or higher, add the following parameter to the file:
    <param name="Threshold" value="LEVEL"></param>

    For example:

    <appender name="FILE" class="jetbrains.charisma.main.MultiplexingRollingFileAppender"> <param name="File" value="/logs/youtrack.log"></param> <param name="MaxFileSize" value="10Mb"></param> <param name="MaxBackupIndex" value="30"></param> <param name="Threshold" value="WARN"></param> <layout class="org.apache.log4j.PatternLayout"><param name="ConversionPattern" value="%d{DATE} %-5p [%-30.30c{1}] [%-50.50t] %m%n"></param> </layout> </appender>
  3. Save and close the log4j.xml file.

    That's it!

Available Logging Levels

The following levels of logging are available:

LevelDescription
INFODesignates informational messages that highlight the progress of the application at coarse-grained level.
DEBUGDesignates fine-grained informational events that are most useful to debug an application.
TRACEDesignates finer-grained informational events than the DEBUG level.
TRACE_INTLogs the integer value for TRACE events.
WARNDesignates potentially harmful situations.
ERRORDesignates error events that might still allow the application to continue running.
FATALDesignates very severe error events that will presumably lead the application to abort.
ALLTurns on logging for all events. This level has the lowest possible rank.
OFFTurns off logging for all events. This level has the highest possible rank.
Last modified: 2 February 2017