I installed this bundle to CQ5.6.1
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.log</artifactId>
<version>4.0.0</version>
</dependency>
It works good, I have problem only with the additivity flag.
If I add a Apache Sling Logging Logger Configuration (org.apache.sling.commons.log.LogManager.factory) for a specific package, it won't be additive so it doesn't inherit the configuration from the parent loggers.
I'm using an external logback.xml.
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
<jmxConfigurator/>
<newRule pattern="*/configuration/osgi" actionClass="org.apache.sling.commons.log.logback.OsgiAction"/>
<newRule pattern="*/configuration/appender-ref-osgi" actionClass="org.apache.sling.commons.log.logback.OsgiAppenderRefAction"/>
<osgi/>
<appender name="syslog" class="net.logstash.logback.appender.LogstashSocketAppender">
<host>HOST</host>
<port>PORT</port>
</appender>
<logger name="com.my.package" level="INFO"/>
<root level="WARN">
<appender-ref ref="syslog" />
</root>
</configuration>
I also have an OSGi config:
org.apache.sling.commons.log.file="logs/other.log"
org.apache.sling.commons.log.level="debug"
org.apache.sling.commons.log.file.size="'.'yyyy-MM-dd"
org.apache.sling.commons.log.file.number=I"7"
org.apache.sling.commons.log.pattern="{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}"
org.apache.sling.commons.log.names="com.my.package.other"
But logs from com.my.package.other never goes to the syslog.
If I add this line to my logback.xml:
<logger name="com.my.package.other" level="INFO"/>
Then on /system/console/slinglog I can see that the logger com.my.package.other is not additive.
So How can I use logs configured by org.apache.sling.commons.log.LogManager.factory as additive loggers?
Thanks in advance!