Then it's different sift appenders that you have to define.
Generally speaking, you don't need sift for what you want: if your bundles use different loggers, then, just create the logger category in the pax-logging config.
Regards JB On 06/30/2016 01:56 PM, Debraj Manna wrote:
Yeah if I enable sifting appender let's say with a config and add it to rootLogger log4j.appender.sift.threshold=DEBUG Then this will make log level DEBUGfor all bundles. I am trying to ask is let's say I have two bundles1& bundles2and I want bundle1 's log level to be DEBUGand bundle2log level to be ERROR. On Thu, Jun 30, 2016 at 2:12 PM, Jean-Baptiste Onofré <[email protected] <mailto:[email protected]>> wrote: Hi, I don't see the sift appender enable for the root logger. You should have: log4j.rootLogger=DEBUG, async, sift, osgi:* Regards JB On 06/30/2016 08:23 AM, Debraj Manna wrote: In |Karaf 3.0.5| running under |Servicemix 6.1.0| my |org.ops4j.pax.logging.cfg| looks like below:- |# Root logger log4j.rootLogger=DEBUG, async, osgi:* log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer # To avoid flooding the log when using DEBUG level on an ssh connection and doing log:tail log4j.logger.org.apache.sshd.server.channel.ChannelSession = INFO # CONSOLE appender not used by default log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id <http://bundle.id> <http://bundle.id>} - %X{bundle.name <http://bundle.name> <http://bundle.name>} - %X{bundle.version} | %X | %m%n # File appender log4j.appender.out=org.apache.log4j.RollingFileAppender log4j.appender.out.layout=org.apache.log4j.PatternLayout log4j.appender.out.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id <http://bundle.id> <http://bundle.id>} - %X{bundle.name <http://bundle.name> <http://bundle.name>} - %X{bundle.version} | %X | %m%n log4j.appender.out.file=/tmp/servicemix.log log4j.appender.out.append=true log4j.appender.out.maxFileSize=1024MB log4j.appender.out.maxBackupIndex=10 # Sift appender log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender log4j.appender.sift.key=bundle.name <http://bundle.name> <http://bundle.name> log4j.appender.sift.default=servicemix log4j.appender.sift.appender=org.apache.log4j.FileAppender log4j.appender.sift.appender.layout=org.apache.log4j.PatternLayout log4j.appender.sift.appender.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X | %m%n log4j.appender.sift.appender.file=/tmp/$\\{bundle.name <http://bundle.name> <http://bundle.name>\\}.log log4j.appender.sift.appender.append=true # Async appender log4j.appender.async=org.apache.log4j.AsyncAppender log4j.appender.async.appenders=out| | Now this logger config is dumping Karaf's debug log as well whereas my intention is to |DEBUG| only a specific bundle. Can some one let me know if it is possible to set different log levels for different bundles? | | | -- Jean-Baptiste Onofré [email protected] <mailto:[email protected]> http://blog.nanthrax.net Talend - http://www.talend.com
-- Jean-Baptiste Onofré [email protected] http://blog.nanthrax.net Talend - http://www.talend.com
