Overiding OOB log files configuration via pipeline | Community
Skip to main content
New Participant
March 1, 2024

Overiding OOB log files configuration via pipeline

  • March 1, 2024
  • 2 replies
  • 926 views

How to override OOB logger configuration like error.log, access.log and upgrade.log

 

Let say AEM creates OOB Log files like request.log, history.log and upgrade.log files etc. as part of AEM installation. We have different environements and so many inatnces. We want to maintain the same log level (reset to info in every deployment) in all environment for all the files In case of maually someone changed the log level to debug / ERROR level or log file location (to write cloudwatch in aws need to override default log file location). I'm trying to add the logger configuration to override for OOB log files but it isn't overriding instead creating a new entry in the logger configuration.

 

Any leads.? Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

kautuk_sahni
Employee
March 7, 2024

@madalavenkat7 Did you find the suggestion helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni
New Participant
March 7, 2024

Hello @kautuk_sahni , as I mentioned in my comments this issue isn't resolved yet, still looking for more information from other mates.

SureshDhulipudi
New Participant
March 1, 2024

 

In AEM, you can override the default logger configuration by creating an OSGi configuration for the org.apache.sling.commons.log.LogManager.factory.config PID

 

Create a configuration file: Create a file named org.apache.sling.commons.log.LogManager.factory.config-mylogger.cfg.json in your project's src/main/resources/OSGI-INF/config directory. Replace mylogger with the name of your logger.

 

 

New Participant
March 1, 2024

Thanks @sureshdhulipudi. I agree the above approach for custom logger configuration, but the OOB logger configuration isn't getting override instead creating a new entry in the logger configuration. I tried the above approach by creating logger configuration 

"org.apache.sling.commons.log.LogManager.factory.config~access.cfg.json"
1. My configuration to override access.log file
 

 

2. Created another entry in the OSGI configuration instead of override.

 

3. Created another configuration file intead of overriding the existing file under AEM installtion folder. (/crx-quickstart/launchpad/config/org/apache/sling/commons/log/logManager/factory)