Expand my Community achievements bar.

Overiding OOB log files configuration via pipeline

Avatar

Level 2

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.

4 Replies

Avatar

Community Advisor

Screen Shot 2024-02-29 at 11.19.00 PM.png

 

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.

 

 

Avatar

Level 2

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
 
madalavenkat7_3-1709273778249.png

 

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

 madalavenkat7_4-1709273834712.png

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)

 

madalavenkat7_5-1709273897020.png

 

 

 

 

 
 

 

 

Avatar

Administrator

@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

Avatar

Level 2

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