dpsenner commented on a change in pull request #43: Enhance the filter to
support filter the exception type name.
URL: https://github.com/apache/logging-log4net/pull/43#discussion_r243731442
##########
File path: src/Filter/ExceptionTypeFilter.cs
##########
@@ -0,0 +1,54 @@
+using log4net.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace log4net.Filter
+{
+ public class ExceptionTypeFilter : FilterSkeleton
+ {
+ public ExceptionTypeFilter()
+ {
+ this.AcceptOnMatch = true;
+ }
+
+ /// <summary>
+ /// Set the exception type name to filter
+ /// </summary>
+ public string ExceptionTypeName { get; set; }
Review comment:
These properties are not supported on ancient frameworks like .net 2.0. By
changing the getter and setter to rely on a backing field this contribution
will also build against .net 2.0. Further it allows the implementation to
resolve the type behind the string and do the expensive reflection only once
and not for any future log event.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services