Description
Here's the relevant parts of my org.ops4j.pax.logging.cfg file:
# File appender
log4j.appender.out=org.apache.log4j.RollingFileAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
log4j.appender.out.file=${karaf.data}/log/karaf.log
log4j.appender.out.append=true
log4j.appender.out.maxFileSize=1MB
log4j.appender.out.maxBackupIndex=10
log4j.logger.com.peapod=DEBUG, out
Then, inside a bundle class, I have a private static final Logger from SLF4J. Doing the following won't log anything anywhere:
LOGGER.debug("Hello, world!"); LOGGER.error("Not even this!");
Viewing the headers of my bundle show the following in the Import-Package attribute:
org.slf4j;version="[1.7,2)"
For the Pax logging API bundle, it has the following in its Export-Package attribute:
org.slf4j;uses:="org.slf4j.helpers,org.slf4j.spi";provider=paxlogging;version=1.7.1
The only way I've been able to log anything whatsoever has been to inject the OSGi LogService which shouldn't be required. I'm using OPS4J Pax Logging version 1.7.2 if that helps (the 1.7.1 is for SLF4J apparently).