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 --> <logger additivity="false" name="org.hippoecm.hst.container.HstDelegateeFilterBean"> <level value="debug"/> <appender-ref ref="performance"/> </logger> <!-- to see logging about how long HST model (re)loading takes --> <logger additivity="false" name="org.hippoecm.hst.configuration.model.HstManagerImpl"> <level value="info"/> <appender-ref ref="performance"/> </logger> <!-- to see logging about how long searches take --> <logger additivity="false" name="org.hippoecm.hst.content.beans.query.HstQueryImpl"> <level value="debug"/> <appender-ref ref="performance"/> </logger>