Configure Log4j for Bloomreach Cloud
Introduction
Goal
Configure Log4j in your Bloomreach Experience Manager project for deployment in Bloomreach Cloud.
Background
Bloomreach Cloud supports Log4j version 2.x. The logs are exposed at Humio. Account details are provided by Bloomreach.
The Bloomreach Cloud platform captures the following output:
- audit.log
- cms.log
- site.log
- catalina std out
Log4j Configuration
Bloomreach Experience Manager projects created using a recent Bloomreach Experience Manager Maven archetype already have Log4j configured out-of-the-box.
Make sure the log4j configuration file is named log4j2.xml.
If your project was created using an older version of the archetype and subsequently upgraded, or if your project was not created using the archetype at all, make sure your Log4j configuration looks similar to:
<!-- cms.log --> <RollingFile name="cms" fileName="${sys:catalina.base}/logs/cms.log" filePattern="${sys:catalina.base}/logs/cms.log.%d{yyyy-MM-dd}"> <LookupFilter key="jndi:logging/contextName" value="cms" onMatch="ACCEPT"/> <PatternLayout pattern="%d{dd.MM.yyyy HH:mm:ss} %-5p [%C.%M():%L] %m%n"/> <Policies> <TimeBasedTriggeringPolicy/> </Policies> </RollingFile>
Do not output your log messages to standard output or standard error, otherwise they will not end up in the Humio logs.