In the log4net version 1.2.11 there was the log4net.Appender.AsyncAppender class.
My following log4net configuration works great with the 1.2.11 version of the log4net:
<appender name="AsyncAppender" type="log4net.Appender.AsyncAppender">
<appender-ref ref="RollingFileAppender" />
<appender-ref ref="ColoredConsoleAppender" />
<appender-ref ref="SmtpAppender" />
</appender>
After upgrading to the 1.2.12 or to the currently latest 1.2.13 version, I'm getting following exception when my app starts:
A first chance exception of type 'System.TypeLoadException' occurred in log4net.dll
Additional information: Could not load type [log4net.Appender.AsyncAppender]. Tried assembly [log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a] and all loaded assemblies
I've taken a look into the log4net 1.2.11 assembly and found the log4net.Appender.AsyncAppender type, but there is no such type in the 1.2.12 and 1.2.13 version assemblies anywhere.
I've googled and researched at the log4net sources repository, but I can't find the answer what's happened with the log4net.Appender.AsyncAppender class in the latest versions of the log4net.
Could anybody answer that question please?
The various AsyncAppender
classes are now part of the Log4Net.Async
assembly, as developed by Chris Haines.
<appender name="AsyncRollingFileAppender" type="Log4Net.Async.AsyncRollingFileAppender,Log4Net.Async" >
//.....
</appender>
These are available as a NuGet package (see https://www.nuget.org/packages/Log4Net.Async/) and the source is available on GitHub at https://github.com/cjbhaines/Log4Net.Async.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With