Loading...

log4j-user@logging.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Thread-specific appenders Curt Arnold Fri Oct 19 00:08:34 2007


On Oct 16, 2007, at 10:40 PM, Aditya Prasad wrote:

Three questions:

1) Is there an existing class I should be using instead?


I don't think there is one that addresses your specific needs at this time. Probably over a year ago, there was a substantial amount of discussion on a multifile appender to address many different use cases including file per thread and some initial code was committed into the sandbox, however I got distracted and no one else was contributing, so it has languished there. I'd like to pick up again, finish it off and move it into extras, but my priority right now is getting a log4cxx release out.

2) Should I not have implemented Appender directly?  I thought about
extending FileAppender so I could expose its interface, but
AppenderSkeleton has final methods that I probably want to override.

I'd recommend extending AppenderSkeleton and if you run into a final method that you feel you need to override, then post something on the list to discuss the issue. You'd then still have the option of switching to implement Appender directly.


3) Can I not set properties (like the Layout) via log4j.properties if
I do this?  It doesn't seem to work.  (In fact, I can't find any good
documentation on how exactly log4j.properties performs its magic.  I
figured it was a simple IoC pattern, but it appears it's not).


I think that would disappear if you extended AppenderSkeleton. I'm guessing (without looking at your code) that you may not have implemented OptionConverter, but try moving to AppenderSkeleton and see what happens.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]