tags:

views:

46

answers:

1

I am trying to understand the differences between the Evaluator property and the LossyEvaluator, of the BufferingForwardingAppender.
I want my appender to be lossy, buffering only 50 messages, and dumping them only if a new LogEvent is Warn of above. Should I use the LevelEvaluator in the LossyEvaluator or the "normal" one?
I'd also like to set up my logging so that all Info messages go through to the file, and not get lost inside the buffer. Is it possible?

+1  A: 

I did not use it yet but looking at the source code I think the LossyEvaluator decides which events that normally would get discarded are written to the log file anyway. So setting the normal evaluator to WARN and the lossy evaluator to INFO should behave the way you want.

Edit: Just made a little test and it works as I thought.

Stefan Egli
Yeah, it seems to work. Thanks.Now I have to figure out why it doesn't work as expected in my real solution, but that is probably a different matter.
Noam Gal