|
[
Permlink
| « Hide
]
Drew Schaeffer added a comment - 18/Dec/06 06:23 PM
built against svn revision 488382
ExceptionEvaluator.cs adds an evaluator that allows buffered appenders to be triggered based on the type of LoggingEvent.ExceptionObject
Why isn't ExceptionType of type Exception:
/// <summary> /// The type that triggers this evaluator. /// </summary> public Exception ExceptionType { get { return m_type; } set { m_type = value; } } We know from the Exception property on LoggingEvent that the type must be at least Exception. +1 for making the signature "public Exception ExceptionType". It seemed intuitive to make ExceptionType of type Type. Otherwise, when creating an ExceptionEvaluator you would have to set ExceptionType to an instance of the type of exception you want to trigger on. ie
ExceptionEvaluator eval = new ExceptionEvaluator(); eval.ExceptionType = new ApplicationException(); This would certainly work but ExceptionEvaluator.IsTriggeringEvent would still be comparing the type. ie m_type.GetType() == loggingEvent.ExceptionObject.GetType() So if the type of exception is what is being compared why not have ExceptionType be of type Type? Doh! You're absolutely correct. I must have been thinking about something else when I wrote that.
Fixed in r489241: Added ExceptionEvaluator that triggers a BufferingAppenderSkeleton to flush its buffer when a certain Exception is detected.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||