You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Dominik Psenner (JIRA)" <ji...@apache.org> on 2016/01/06 17:16:39 UTC

[jira] [Updated] (LOG4NET-500) 1.2.15 RollingFileAppender is 60% slower than 1.2.11

     [ https://issues.apache.org/jira/browse/LOG4NET-500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominik Psenner updated LOG4NET-500:
------------------------------------
    Priority: Minor  (was: Major)

> 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
>            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)