Documentation Center

Configuring logging

Update your existing logback.xml to implement Experience Optimization logging on the Presentation Server. If your Web application does not already have a logback.xml file, you can simply rename the logback_sample.xml file to logback.xml and use it directly.

Before you begin

It is assumed you have already copied the logback_sample.xml file, from the Experience Optimization installation media Content Delivery\configuration\samples folder, into the classes (Java) or config (.NET) subdirectory of your Web application.

Procedure

  1. Open your existing logback.xml configuration file in a text editor.
  2. Open the Experience Optimization logback_sample.xml configuration file:
  3. In the logback_sample.xml file, copy the <!-- Appenders --> section into the logback.xml file:
    <appender name="rollingExperienceOptimizationLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
     <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
       <fileNamePattern>${log.folder}/experienceoptimization.%d{yyyy-MM-dd}.log</fileNamePattern>
       <maxHistory>${log.history}</maxHistory>
     </rollingPolicy>
    
     <encoder>
       <pattern>${log.pattern}</pattern>
     </encoder>
       <prudent>true</prudent>
    </appender>
    The code assumes the properties added by the Content Delivery logback.xml file are available at the top of the file:
    <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"/>
  4. In the logback_sample.xml file, copy the <!-- Loggers --> section into the logback.xml file:
    <logger name="com.tridion.smarttarget" level="${log.level}">
      <appender-ref ref="rollingExperienceOptimizationLog" /> 
    </logger>
    <logger name="com.tridion.smarttarget.ambientdata" level="${log.level}">
      <appender-ref ref="rollingExperienceOptimizationLog" />
    </logger>

    Additionally, for a .NET Web application:

    <logger name="Tridion.ExperienceOptimization" level="${log.level}">
      <appender-ref ref="rollingExperienceOptimizationLog" /> 
    </logger>
  5. Save and close logback.xml.