How to make MDC sift logging work?

One Star

How to make MDC sift logging work?

Hello,
I have implemented a service, assigned jobs to operations. I would like to enable sift logging. I have read all the information I could find  and seems it should work by default but see no other log file.
org.ops4j.pax.logging.cfg 
log4j.rootLogger=INFO, out, sift, osgi:VmLogAppender
# Sift appender
log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender
log4j.appender.sift.key=bundle.name
log4j.appender.sift.default=tesb
log4j.appender.sift.appender=org.apache.log4j.FileAppender
log4j.appender.sift.appender.layout=org.apache.log4j.PatternLayout
log4j.appender.sift.appender.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n
log4j.appender.sift.appender.file=${karaf.data}/log/$\\{bundle.name\\}.log
log4j.appender.sift.appender.append=true
https://help.talend.com/search/all?query=OSGi+specific+MDC+attributes&content-lang=en
Is there something I am missing?
Thank you,
Viktor
One Star

Re: How to make MDC sift logging work?

Hello,
sift logging works, log files are under karaf.data folder. Just it creates log file for every bundle.
My expectation was to have per application logging. Is there a way to tell a service to log all messages  (cxf messages, errors, warn, info) to one file I define?
Similar you can do in project settings/stats&logs, but that does not apply for INFO.
Thank you,
Viktor
One Star

Re: How to make MDC sift logging work?

Hi Viktor,
Did you manage to get any further with this? I am in the same position as you in that we are logging at bundle-level but I would like an application-level log so that all log messages and exceptions in a single route are logged into their own file,
Sam
One Star

Re: How to make MDC sift logging work?

Hello Sam, unfortunately no, did not manage to do that. Viktor