in src/log4net/Core/ExceptionEvaluator.cs [81:97]
public bool IsTriggeringEvent(LoggingEvent loggingEvent)
{
loggingEvent.EnsureNotNull();
if (TriggerOnSubclass && loggingEvent.ExceptionObject is not null)
{
// check if loggingEvent.ExceptionObject is of type ExceptionType or subclass of ExceptionType
Type exceptionObjectType = loggingEvent.ExceptionObject.GetType();
return ExceptionType is null || exceptionObjectType == ExceptionType || ExceptionType.IsAssignableFrom(exceptionObjectType);
}
if (!TriggerOnSubclass && loggingEvent.ExceptionObject is not null)
{
// check if loggingEvent.ExceptionObject is of type ExceptionType
return loggingEvent.ExceptionObject.GetType() == ExceptionType;
}
// loggingEvent.ExceptionObject is null
return false;
}