[ https://issues.apache.org/jira/browse/LOG4NET-500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15105024#comment-15105024 ]
Dominik Psenner commented on LOG4NET-500: ----------------------------------------- Apologies for not getting back to you earlier, I have been busy. This is well understandable. LOG4NET-487 is exactly about that and that story should improve rolling by making the rolling lock strategy configurable. In the case where only one process rolls one could get better performance by configuring the rolling file appender to not lock the process of rolling. At the moment rolling is always locked to prevent race conditions. If you happen to need this anytime soon, patches receive a warm welcome! :-) > 1.2.15 RollingFileAppender is 60% slower than 1.2.11 > ---------------------------------------------------- > > Key: LOG4NET-500 > URL: https://issues.apache.org/jira/browse/LOG4NET-500 > Project: Log4net > Issue Type: Improvement > Components: Appenders > Affects Versions: 1.2.15 > Environment: 4.5.2 .NET Framework > Reporter: Larry Aucoin > Assignee: Dominik Psenner > Priority: Minor > > 1.2.15 RollingFileAppender is 60% slower than 1.2.11. I am using the > following code and app.config file to test the 2 versions. > APP.CONFIG > ======================== > <?xml version="1.0" encoding="utf-8"?> > <configuration> > <configSections> > <section name="log4net" > type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> > </configSections> > <log4net> > <root> > <level value="DEBUG" /> > <appender-ref ref="RollingFileAppender" /> > </root> > <appender name="RollingFileAppender" > type="log4net.Appender.RollingFileAppender, log4net"> > <file value="C:\TraceLogging\TraceLoggingTeset1.2.15.log" /> > <appendToFile value="true" /> > <rollingStyle value="Size" /> > <maxSizeRollBackups value="10" /> > <maximumFileSize value="20MB" /> > <staticLogFileName value="true" /> > <layout type="log4net.Layout.PatternLayout, log4net"> > <param name="ConversionPattern" value="%date [%thread] %-5level > [%logger].%message%newline" /> > </layout> > </appender> > </log4net> > <startup> > <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/> > </startup> > </configuration> > ======================== > CODE: > ======================== > using System; > using System.Collections.Generic; > using System.ComponentModel; > using System.Data; > using System.Drawing; > using System.Linq; > using System.Text; > using System.Threading.Tasks; > using System.Windows.Forms; > using System.Diagnostics; > using log4net.Core; > namespace TraceLoggingTest > { > public partial class Form1 : Form > { > public log4net.ILog Logger; > public Form1() > { > InitializeComponent(); > Logger = log4net.LogManager.GetLogger("Form1"); > log4net.Config.XmlConfigurator.Configure(); > } > private void btnTest_Click(object sender, EventArgs e) > { > > Logger.Debug("====================================================="); > Stopwatch sw = new Stopwatch(); > sw.Start(); > for (int i = 0; i < 5000; i++) > { > Logger.Debug("Write item [" + i.ToString() + "]..."); > } > sw.Stop(); > Logger.Debug("TOTAL TIME [" + sw.ElapsedMilliseconds.ToString() + > "]"); > this.lblTime.Text = sw.ElapsedMilliseconds.ToString() + " ms"; > > Logger.Debug("====================================================="); > } > } > } > ======================== -- This message was sent by Atlassian JIRA (v6.3.4#6332)