Equinox Sling Registration Configuration

I am trying to use Apache Sling logging in an Equinox project. It works fine, but I can't get Sling to use my configuration file. I am using the standard xml configuration, which should work according to the Sling documentation . But no matter where I put the configuration file, Sling just doesn't use it.

My log configuration is as follows:

<?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> <encoder> <pattern>%d{dd.MM.yyyy HH:mm:ss.SSS} *%level* [%thread] %logger %message%n</pattern> </encoder> </appender> <root level="debug"> <appender-ref ref="CONSOLE" /> </root> </configuration> 
+7
java logback osgi equinox sling
source share
1 answer

The only way to force Sling to use my configuration file is to pass the location of the configuration file as a VM argument as follows: -Dorg.apache.sling.commons.log.configurationFile=/path/to/logbackconfigfile , where the path is the full path to the configuration file. Unfortunately, I was not able to get it to work with a relative path.

+1
source share

All Articles