Check logs for specific java class in AEMaaCS | Community
Skip to main content
Level 2
January 7, 2025
Solved

Check logs for specific java class in AEMaaCS

  • January 7, 2025
  • 1 reply
  • 785 views

Hello guys ,

 

As per this docs - https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/debugging/debugging-aem-as-a-cloud-service/logs  , custom log file is not supported in  AEM aa CS .

I have tried writing custom logs to error.log in org.apache.sling.commons.log.LogManager.factory.config~test.cfg.json using below configuration . But I am still not getting custom log statements in aemerror.log file ( from developer console ) . 

 

 

 

{ "org.apache.sling.commons.log.names": [ "com.brandnew.core.models.TestClass" ], "org.apache.sling.commons.log.level": "INFO", "org.apache.sling.commons.log.file": "logs/error.log", "org.apache.sling.commons.log.additiv": "false" }

 

Could you guys please suggest any other solution or point out any mistake in above steps?

 

 

Best answer by daniel-strmecki

Hi @newbie34,

the below configuration without specifying a log file works for me on AEMaaCS:

{ "org.apache.sling.commons.log.level": "$[env:LOG_LEVEL_CUSTOM;default=error]", "org.apache.sling.commons.log.names": [ "com.my-project.cms" ] }

 

Hope this helps,

Daniel

1 reply

daniel-strmecki
Community Advisor and Adobe Champion
daniel-strmeckiCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
January 7, 2025

Hi @newbie34,

the below configuration without specifying a log file works for me on AEMaaCS:

{ "org.apache.sling.commons.log.level": "$[env:LOG_LEVEL_CUSTOM;default=error]", "org.apache.sling.commons.log.names": [ "com.my-project.cms" ] }

 

Hope this helps,

Daniel

newbie34Author
Level 2
January 7, 2025

Hi @daniel-strmecki , 

Thanks for replying . 

So are you able to see log statements for specified class in "aemerror" file from developer console?

 

daniel-strmecki
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 7, 2025

Hi @newbie34,

yes. You should see the log statement also without any custom config, but this enables us to lower the log level to INFO for our specific packages.

 

Good luck,

Daniel