Configuring logging on the Content Delivery server

The logback.xml file is the configuration file for the logback logging framework used by Content Delivery.

About this task

Procedure

  1. Open the file logback.xml in a plain-text editor or XML editor:
    • On Content Delivery, the logback.xml file is located in the config/ (.NET) or /classes (Java) subfolder if Content Delivery is running as a Web application, otherwise in the root of your Content Delivery installation.
  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="c:/tridion/log"/>
    <property name="log.level" value="WARN"/>
    <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 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.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. 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.
  4. Save and close logback.xml.