Use log4j v1.x at Runtime with Bloomreach Experience Manager 12
Bloomreach Experience Manager 12 requires log4j2 for development and uses it by default at runtime. However, you can configure the system to use log4j v1.x at runtime if necessary.
To build a CMS 12 distribution that uses log4j v1.x at runtime, complete the following steps:
Prerequisites
- A Bloomreach Experience Manager 12 distribution archive.
- Access to modify files within the distribution.
Steps
-
Open the distribution archive.
-
In the
confdirectory, replace the existinglog4j2.xmlfile with a validlog4j.xmlconfiguration file. -
In the
shared/libdirectory, replace the following JAR files (versions may vary):
jcl-over-slf4j-1.7.25.jar log4j-api-2.8.2.jar log4j-core-2.8.2.jar log4j-slf4j-impl-2.8.2.jar slf4j-api-1.7.25.jar
with these files:
jcl-over-slf4j-1.7.6.jar log4j-1.2.17.jar slf4j-api-1.7.6.jar slf4j-log4j12-1.7.6.jar
Verification
After making these changes, start the application and verify that logging is handled by log4j v1.x. Check the logs to confirm that log4j v1.x is active and no log4j2 classes are loaded at runtime.
Notes
- Only use log4j v1.x at runtime if you have a specific requirement that prevents you from using log4j2.
- Ensure that your
log4j.xmlconfiguration matches your application's logging requirements. - The exact JAR versions may differ depending on your environment. Adjust as needed to match your setup.