Content Delivery uses the logback logging framework. The SmartTarget installer for Content Delivery updates your existing logback.xml for Content Delivery automatically for you unless you chose not to overwrite the file, in which case you need to update the file manually as described below.
Procedure
- Open the
logback.xml configuration file, by default located in your %TRIDION_HOME%\config directory, in a text editor.
- Access the SmartTarget installation media, navigate to the Content Delivery\configuration\samples folder, and open the
logback_sample.xml file in a text editor.
- In the
logback_sample.xml file, copy the <!-- Appenders --> section into the logback.xml file:
<appender name="rollingSmartTargetLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.folder}/smarttarget.%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"/>
- In the
logback_sample.xml file, copy the following <logger> section into the logback.xml file <!-- Loggers --> section:
<logger name="com.tridion.smarttarget" level="${log.level}">
<appender-ref ref="rollingSmartTargetLog" />
</logger>
Note: The other loggers in the
logback_sample.xml are for logging SmartTarget information on the Presentation Server. For more information, see
Configuring logging.
- Save and close
logback.xml.