Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Is there a way to exclude a package/class from logging in a sling:OsgiConfig file?

Avatar

Level 7

Is there a way to add com.mycomp.myapp to the log.names but exclude com.mycomp.myapp.NoisyClass?

Is it allowed to use com.mycomp.myapp.NoisyClass:OFF in the log.names?

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" org.apache.sling.commons.log.file="logs/ss.log" org.apache.sling.commons.log.level="trace" org.apache.sling.commons.log.names="[com.mycomp.myapp,com.mycomp.myapp.NoisyClass:OFF]" org.apache.sling.commons.log.pattern="\{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}"/>
1 Accepted Solution

Avatar

Correct answer by
Level 10
1 Reply

Avatar

Correct answer by
Level 10

This subject is discussed here:

AEM Logging

Sling Logging