I've been using Log4Net on a few high traffic websites for a couple of years, and I cannot say that I am a happy customer. So, wanted to see if anybody else has the same concerns:
The CPU overhead with RollingFileAppendor is massive. Some of my websites need to trace 5-10GB per day, and when I enable logging, the CPU utilization more than doubles. I would like to avoid the discussion of why so much tracing is needed. Some mission critical apps have to trace every step of every transaction.
Rolling by date is often unreliable (it logs fine during the day, but then messes up the last day's log file around midnight). This behavior is inconsistent. I've seem more than a few people online that complain on this and nobody seems to have a good solution.
Last but not least, I have not seen any new releases on the Apache website during the last three years. So, this starts to look as an abandoned open source project, and that usually means that it's time to move on to some alternative framework.
So, I am considering giving up Log4Net in favor of the Microsoft Enterprise Library or something else. Is anybody here having the same issues as me?
NET Standard (2.0. 7 and beyond). In fact, I can use Log4Net alongside the default logging API for . NET Core: Microsoft.
Here's my appender config for comparison:
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender, log4net" >
<param name="File" value="log" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<maxSizeRollBackups value="7" />
<layout type="log4net.Layout.PatternLayout, log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
</layout>
</appender>
You could look at using ASP.NET 2.0's Health Monitoring, and How To: Use Health Monitoring in ASP.NET 2.0
But I think you are going to have similiar problems. You are trying to use a logging tool as an audit tool, not exactly what it was designed for.
"Some mission critical apps have to trace every step of every transaction." - This is information that I would be logging to the database as part of a transaction. How could you guarantee the information is correct if it runs outside of a transaction?
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