[logback-user] Splitting log files by session

Andreas Johnsen osthekake at gmail.com
Fri Jul 12 13:05:54 CEST 2013


I am developing an application where I need to make separate log files for
each time a certain process is run. This process can have multiple
instances at once. Preferably I would like a separate method for these
types of logs (like info, warning, trace etc) but I would be okay with
simply using trace for these logs. I would still like any error or warning
that spawns in this process to be logged to the standard error file (global
for entire project). I'm trying to configure logback to do this for me.

My initial idea was to create my own appender, and somehow figure out which
process the log request was coming from, but I ran into a problem actually
doing that, since I apparently cannot pass anything useful to the appender
in runtime? Or rather I'm not sure how to keep track of and always use the
appender that belongs to that particular process.

I then proceeded to get lost in the vast number of classes and I am now
looking at perhaps modifying a RollingPolicy to do my bidding.

Any ideas or clarifications on this topic would be very welcome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130712/494a48b0/attachment.html>


More information about the Logback-user mailing list