karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: [K4.1] Pax Logging: Sift appender
Date Thu, 28 Mar 2019 16:55:49 GMT
Hi,

FYI, I just tested the following without problem:

I added a Routing appender ref on the rootLogger:

log4j2.rootLogger.appenderRef.Sift.ref = Routing

The Routing logger uses MDC to have a file per bundle (using bundle name):

log4j2.appender.routing.type = Routing
log4j2.appender.routing.name = Routing
log4j2.appender.routing.routes.type = Routes
log4j2.appender.routing.routes.pattern = \$\$\\\{ctx:bundle.name\}
log4j2.appender.routing.routes.bundle.type = Route
log4j2.appender.routing.routes.bundle.appender.type = 
RollingRandomAccessFile
log4j2.appender.routing.routes.bundle.appender.name = 
Bundle-\$\\\{ctx:bundle.name\}
log4j2.appender.routing.routes.bundle.appender.fileName = 
${karaf.log}/bundle-\$\\\{ctx:bundle.name\}.log
log4j2.appender.routing.routes.bundle.appender.filePattern = 
${karaf.log}/bundle-\$\\\{ctx:bundle.name\}.log.%i
log4j2.appender.routing.routes.bundle.appender.append = true
log4j2.appender.routing.routes.bundle.appender.layout.type = PatternLayout
log4j2.appender.routing.routes.bundle.appender.layout.pattern = 
${log4j2.pattern}
log4j2.appender.routing.routes.bundle.appender.policies.type = Policies
log4j2.appender.routing.routes.bundle.appender.policies.size.type = 
SizeBasedTriggeringPolicy
log4j2.appender.routing.routes.bundle.appender.policies.size.size = 8MB

In data/log, I can see one file per bundle (with the name).

So it works fine.

I'm adding those sections commented in the provided 
etc/org.ops4j.pax.logging.cfg.

Regards
JB

On 28/03/2019 13:53, Jayamani wrote:
> Hi Grzegorz,
> I will try with JDK8, thanks.
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html
> 

Mime
View raw message