How we can do logger configuration In AEM as cloud instance? | Community
Skip to main content
Level 2
September 1, 2024
Solved

How we can do logger configuration In AEM as cloud instance?

  • September 1, 2024
  • 1 reply
  • 1333 views

we need to do configuration for all envinorments

AEM Environment   |  Log Level

->Developement      |   Debug

--> Stage -----            |    WARN

--> PROD -----           |     Error

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

@ramsaipavan 

You can create logger configuration in ui.config folder based on run modes. Environment variable can be used while defining the value of log level and it can be changed at runtime.

{
"org.apache.sling.commons.log.names": [
"com.adobe.aem.guides.wknd"
],
"org.apache.sling.commons.log.level":

"$[env:LOG_LEVEL;default=ERROR]"


}

https://github.com/adobe/aem-guides-wknd/blob/main/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.prod/org.apache.sling.commons.log.LogManager.factory.config~wknd.cfg.json

 

 

1 reply

AMANATH_ULLAH
Community Advisor
AMANATH_ULLAHCommunity AdvisorAccepted solution
Community Advisor
September 1, 2024

@ramsaipavan 

You can create logger configuration in ui.config folder based on run modes. Environment variable can be used while defining the value of log level and it can be changed at runtime.

{
"org.apache.sling.commons.log.names": [
"com.adobe.aem.guides.wknd"
],
"org.apache.sling.commons.log.level":

"$[env:LOG_LEVEL;default=ERROR]"


}

https://github.com/adobe/aem-guides-wknd/blob/main/ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.prod/org.apache.sling.commons.log.LogManager.factory.config~wknd.cfg.json

 

 

Amanath Ullah
Level 2
September 2, 2024

@amanath_ullah 

 

Can we do all run modes in a single config file

AMANATH_ULLAH
Community Advisor
Community Advisor
September 2, 2024

@ramsaipavan 

Yes you can use single file under config folder for all runmodes and then set the desired log level value using environment variable

 

 

Amanath Ullah