Enable basic profile logging - BloomReach Experience - Open Source CMS

This article covers a Hippo CMS version 10. There's an updated version available that covers our most recent release.

28-05-2015

Enable basic profile logging

This document describes how to enable logging of profile information to a separate log file.

Note that you can also in production switch on and off the HST Page diagnostics, which logs how long in milliseconds different parts of the HST request cycle took to execute. It gives you a very strong insight in the parts that take long for a request. The only thing not accounted in there is how long the HST model takes to load after something has changed in the configuration. Those numbers can be achieved by the log category below for the HstManagerImpl.

Add a appender to the log4j.xml configuration

log4j.xml:

<appender name="performance" class="org.apache.log4j.DailyRollingFileAppender">
  <param name="File" value="${catalina.base}/logs/performance.log"/>
  <param name="Append" value="true"/>
  <param name="DatePattern" value="'.'yyyy-MM-dd"/>
  <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern"
           value="%d{dd.MM.yyyy HH:mm:ss} %-5p [%c] %m%n"/>
  </layout>  
  <filter class="org.onehippo.cms7.logging.log4j.MdcOrJndiPropertyFilter">
    <param name="name" value="logging/contextName" />
    <param name="resourceRef" value="true" />
    <param name="value" value="site" />
    <param name="onMatchOption" value="ACCEPT" />
  </filter>
</appender>

Set log levels of classes producing performance information. 

log4j.xml:

  <!-- to see logging about how long the total request takes -->
  <category additivity="false" name="org.hippoecm.hst.container.HstDelegateeFilterBean">
    <level value="debug"/>
    <appender-ref ref="performance"/>
  </category>

  <!-- to see logging about how long HST model (re)loading takes -->
  <category additivity="false"
            name="org.hippoecm.hst.configuration.model.HstManagerImpl">
    <level value="info"/>
    <appender-ref ref="performance"/>
  </category>

  <!-- to see logging about how long searches take -->
  <category additivity="false"
            name="org.hippoecm.hst.content.beans.query.HstQueryImpl">
    <level value="debug"/>
    <appender-ref ref="performance"/>
  </category>

 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?