Expand my Community achievements bar.

SOLVED

Check logs for specific java class in AEMaaCS

Avatar

Level 2

Hello guys ,

 

As per this docs - https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/debugging/debuggin...  , 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?

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi @RahulKu8,

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

View solution in original post

4 Replies

Avatar

Correct answer by
Level 9

Hi @RahulKu8,

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

Avatar

Level 2

Hi @daniel-strmecki , 

Thanks for replying . 

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

 

Avatar

Level 9

Hi @RahulKu8,

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