Documentation Center

Configuring logging for a Content Delivery software component

You already set up logging when you installed your Content Delivery software components. But you can configure logging in more detail by editing the logback.xml, the configuration file for the Logback logging framework used by Content Delivery.

About this task

For detailed information about the Logback framework and its configuration, refer to http://logback.qos.ch/documentation.html.

Procedure

  1. In the location of the software component for which you want to activate logging, open logback.xml for editing. This file is located in the configuration location of your software component.
  2. 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="./logs"/>
    <property name="log.level" value="ERROR"/>
    <property name="log.encoding" value="UTF-8"/>
    log.pattern (logging output format)
    The log.pattern property specifies the appearance of log messages using a format string. For example, a log pattern %date %-5level %logger{0} - %message%n would 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.history property specifies the number of log files to back up (the default is 7 files).
    log.folder (logging location)
    The log.folder property specifies the location where log files are saved (defaults to ./logs, that is, the logs/ subfolder of the root location of the Role). You can change this location if you want.
    For example, on the Content Manager Server, you could set the log location to TRIDION_HOME/log, where TRIDION_HOME is the value of the %TRIDION_HOME% environment variable, with the backslashes replaced with forward slashes. By default, the value is c:/Program Files/SDL Web/. If your system was upgraded from a release before SDL Web 8, the value defaults to c:/Program Files/Tridion.
    log.level (logging level)
    To change the default logging level, change the value of the log.level property 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, DEBUG also logs and events covered by INFO, WARN, and ERROR.
    Logging LevelDescription
    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.
    log.encoding (logging encoding)
    The encoding used when writing log files. For example, UTF-16.
  3. To specify parameters rather than hardcoded values in logback.xml, refer to the "Variable substitution" section on this webpage: http://logback.qos.ch/manual/configuration.html.
  4. If you want to enable Logback to apply your configuration changes without having to restart your web application, use the scan and scanPeriod attributes in the configuration element. Refer to http://logback.qos.ch/manual/configuration.html#autoScan.
  5. Save and close logback.xml.
  6. Restart your Content Delivery role or web application.