Configuring Content Delivery logging on the Content Manager server
The logback.xml file is the configuration file for the logback logging framework used by Content Delivery.
About this task
Note: For detailed information about the Logback framework and its configuration, refer to http://logback.qos.ch/documentation.html.
Procedure
- Open the file
logback.xmlin a plain-text editor or XML editor:- On Content Manager, the logback.xml file is located in
%TRIDION_HOME%(defaults to C:\Program Files (x86)\Tridion\).
- On Content Manager, the logback.xml file is located in
- Set the following properties:
<property name="log.pattern" value="%date %-5level %logger{0} - %message%n"/> <property name="log.history" value="7"/> <property name="log.folder" value="c:/tridion/log"/> <property name="log.level" value="WARN"/> <property name="log.encoding" value="UTF-8"/>log.pattern(logging output format)-
The
log.patternproperty specifies the appearance of log messages using a format string. For example, a log pattern%date %-5level %logger{0} - %message%nwould result in messages such as this one:2013-03-11 16:55:34,137 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext. Refer to the online Logback documentation for more information. log.history(number of log files)-
The
log.historyproperty specifies the number of log files to back up (the default is 7 files). log.folder(logging location)-
The
log.folderproperty specifies the location where log files are saved (defaults to c:/Tridion/log). - For example, on the Content Manager Server set the log location to: c:/Program Files (x86)/Tridion/log.
log.level(logging level)-
To change the default logging level, change the value of the
log.levelproperty to one of the values describes in the following table. Note that logging levels are incremental and inclusive; each level logs data for the previous levels. For example,DEBUGalso logs and events covered byINFO,WARN, andERROR.Logging Level Description OFFTurn off logging. ERROR(default)Log events that cause a specific feature of the application to fail. WARNLog events that are potentially harmful. INFOLog neutral, informational messages about high-level functionality being executed. DEBUGLog fine-grained informational messages about low-level functionality being executed, intended to discover the source of a problem. TRACELog highly detailed informational messages about the application's lowest-level activity, ALLMaximum logging level that logs everything. Note: TheDEBUGlevel is intended for hunting down the origin of a particular problem only and will result in a significant performance drop while this level is set. Therefore, it is recommended to set the logging level back to as soon as the problem has been resolved. log.encoding(logging encoding)-
The encoding used when writing log files. For example,
UTF-16.
- If you want to use property substitutions, that is, variables resolved by context such as environment variables, the Logback framework allows you to do so. The simplest way to do this is to define an environment variable (say
Foo) wherever you set up Content Delivery, and insert the string${Foo}in your logging configuration file. Logback now substitutes the string with the value of the environment variable. This approach enables you to reuse the same configuration file (and, say, deploy a WAR file without having to edit this file). For more information, refer to the heading "Property substitution" on this Web page: http://logback.qos.ch/manual/configuration.html. - Save and close
logback.xml.