Issue Details (XML | Word | Printable)

Key: LOG4NET-108
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Nicko Cadell
Reporter: Drew Schaeffer
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Log4net

[PATCH] add support for multiple evaluators in BufferingAppenderSkeletan

Created: 20/Dec/06 10:56 PM   Updated: 14/Jun/08 02:24 PM
Return to search
Component/s: Appenders, Core
Affects Version/s: 1.2.10
Fix Version/s: 1.2.11

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works EvaluatorCollection.cs 2006-12-20 10:59 PM Drew Schaeffer 25 kB
File Licensed for inclusion in ASF works patch-file.diff 2006-12-20 10:57 PM Drew Schaeffer 40 kB
Issue Links:
Reference
 


 Description  « Hide
Currently BufferedAppenders only have support for one evaluator and one lossy evaluator. This is fine when the only available evaluator is LevelEvaluator (as multriple LevelEvaluators do not make sense) but with the addition of ExceptionEvaluator (LOG4NET-107) it would be nice for BufferingAppenderSkeletan to have a collection of evaluators.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Drew Schaeffer added a comment - 20/Dec/06 10:57 PM
build against subversion revision 489214

Drew Schaeffer added a comment - 20/Dec/06 10:59 PM
Typed collection of ITriggeringEventEvaluators.

Drew Schaeffer added a comment - 20/Dec/06 11:02 PM
This patch doesn't depend on LOG4NET-107 but with the addition of ExceptionEvaluators this patch is the next step.

Drew Schaeffer added a comment - 20/Dec/06 11:15 PM
configuration of multiple evaluators is supported by the standard Add methods on the BufferingAppenderSkeletan class. ie

AddEvaluator ( ITriggeringEventEvaluator )
AddLossyEvaluator ( ITriggeringEventEvaluator )

therefore the xml needed to configure these is the same as it was before

<evaluator ... />
<lossyEvaluator ... />

Ron Grabowski added a comment - 21/Dec/06 04:13 AM
Why did you choose to use an EvaluatorCollection instead of a linked list similiar to how IFilters are processed on the AppenderSkeleton?

If the EvaluatorCollection has 5 items in it and the 1st item causes a flush do the remaining 4 items still get a chance to process the LoggingEvent?

Nicko Cadell added a comment - 13/Feb/07 12:11 AM
It would be possible to implement this feature without modifying the BufferingAppenderSkeleton but rather by building another ITriggeringEventEvaluator that holds a collection of child evaluators.
This is in some ways more flexible because it can be used everywhere a ITriggeringEventEvaluator is allowed.

If the implementation is added directly to the BufferingAppenderSkeleton then what strategy should be employed in deciding when to _trigger_. Any evaluator / all evaluators / or a combination? Once this is embedded in the BufferingAppenderSkeleton this would be hard to change, and someone will come up with a convincing argument as to why the implemented strategy is not appropriate for them.

If the strategy is delegated to the implementation of the ITriggeringEventEvaluator then this becomes much more extensible. An ITriggeringEventEvaluator can be written by anyone and deployed in any DLL not just in the log4net DLL.

Ron Grabowski added a comment - 13/Feb/07 03:27 PM
I think what Drew was getting at is that he wants Filters and Evaluators to behave similiar (i.e. allow multiple Evaluators to be added the same way that multiple Filters are added).

BufferingAppenderSkeleton could be changed to hold a linked list of Evaluators similiar to how AppenderSkeleton holds a linked list of Filters.