logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: How to have a separate log file for a thread and all sub threads?
Date Thu, 25 Apr 2019 15:59:26 GMT
On Wed, 24 Apr 2019 at 18:47, Benjamin Jaton <benjamin.jaton@gmail.com> wrote:
> I've implemented the solution based on ThreadGroups. Now I am trying to
> have a separate log level per job. The goal is to be able to set one job in
> DEBUG or TRACE while the others stay in WARN. Possible?
> The RoutingAppender creates an appender per route but as far as I know I
> cannot set a log level on the appender object. I guess filters could be
> used but is there something simpler I'm missing?

I think you'd be better off using markers for that. See
https://logging.apache.org/log4j/2.x/manual/markers.html

You might also be able to just use a naming scheme for your loggers
that automatically makes them separately configurable as typical
loggers. For example, say you use a naming scheme
"com.example.threadgroup.<groupName>" as your loggers. Then you could
configure them by name as usual.

-- 
Matt Sicker <boards@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message