Enable Basic Profile Logging
This page explains how to configure logging for profile information in Bloomreach Content. Profile logging writes performance data to a dedicated log file for analysis.
You can also enable HST Page diagnostics to log execution times for different phases of the HST request cycle. HST Page diagnostics helps identify which parts of the request cycle require the most processing time. However, it does not measure how long it takes to load the HST model after configuration changes. To capture HST model loading times, configure a dedicated logger for HstManagerImpl as described below.
Add an Appender to the Log4j 2 Configuration
Add a RollingFile appender to your log4j2.xml file to write performance logs to a separate file.
<RollingFile name="performance" fileName="${sys:catalina.base}/logs/performance.log" filePattern="${sys:catalina.base}/logs/performance.log.%d{yyyy-MM-dd}"> <LookupFilter key="jndi:logging/contextName" value="site" onMatch="ACCEPT"/> <PatternLayout pattern="%d{dd.MM.yyyy HH:mm:ss} %-5p [%c] %m%n"/> <Policies> <SizeBasedTriggeringPolicy size="10MB"/> </Policies> <DefaultRolloverStrategy max="1" fileIndex="min"/> </RollingFile>
This configuration creates a rolling log file named performance.log in the Tomcat logs directory. The log file rotates daily or when it reaches 10MB.
Set Log Levels for Performance Logging
Define logger entries in log4j2.xml for the classes that produce performance information. Attach these loggers to the performance appender.
<!-- Log total request processing time --> <Logger additivity="false" name="org.hippoecm.hst.container.HstDelegateeFilterBean" level="debug"> <AppenderRef ref="performance"/> </Logger> <!-- Log HST model (re)loading times --> <Logger additivity="false" name="org.hippoecm.hst.configuration.model.HstManagerImpl" level="info"> <AppenderRef ref="performance"/> </Logger> <!-- Log search execution times --> <Logger additivity="false" name="org.hippoecm.hst.content.beans.query.HstQueryImpl" level="debug"> <AppenderRef ref="performance"/> </Logger>
org.hippoecm.hst.container.HstDelegateeFilterBean: Logs the total time for request processing.org.hippoecm.hst.configuration.model.HstManagerImpl: Logs the time required to load or reload the HST model.org.hippoecm.hst.content.beans.query.HstQueryImpl: Logs the duration of search operations.
After updating your log4j2.xml file, restart the application to apply the changes. Performance logs will be written to performance.log for further analysis.