This is nicely related to the repository selector discussion, Jake and I had on
30.11.2008. Well done.
Eduardo Arantes Rodrigues wrote:
Hi,
I had a specific requirement that a certain set of similar Jobs should
be logged one individual file per Job.
That would make things easier to troubleshooting.
With the current FileAppenders implementation it would require a new
appender and category for each Job.
Since, so far, we have already 20 jobs it would be really painful to add
and maintain all of them and also the Jobs can be dynamically added to
the system.
That would break the rule of having one file per Jobs.
I've researched but I couldn't find an appender where the name of the
file to log could be configured dynamically.
Given this requirements my idea was provide a way to use PatternLayout
like file names.
This code allow the fileName to be defined as: "c:/temp/server[%-5p].log"
Depending on the pattern a new file can be generated by class, category
or even by day, hour, ...
I've used the FileAppender code as base
I've provide the JavaDoc for the most important methods.
I hope it's useful and can be added to the project
Regards,
Eduardo
--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]