logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ronald Putz (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LOG4NET-533) Log4Net version uses much more CPU than
Date Tue, 22 Nov 2016 08:35:58 GMT
Ronald Putz created LOG4NET-533:

             Summary: Log4Net version uses much more CPU than
                 Key: LOG4NET-533
                 URL: https://issues.apache.org/jira/browse/LOG4NET-533
             Project: Log4net
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2.15
            Reporter: Ronald Putz
             Fix For: 1.2 Maintenance Release

We switched to the version 1.2.15 in our production system and figured out a general increase.
After a long analysis we have figured out that log4net uses more cpu compared to the version


    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"

    <log4net debug="true">

    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%utcdate{yyyy-MM-dd HH:mm:ss.fff}	[%6thread]
[%36property{context}]	%-5level	%-35.35logger	%-25method	%message%newline" />

    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="c:\mylogfile.txt"/>
      <appendToFile value="true"/>
      <rollingStyle value="Size"/>
      <maxSizeRollBackups value="5"/>
      <maximumFileSize value="10MB"/>
      <staticLogFileName value="true"/>
      <!--filter type="log4net.Filter.StringMatchFilter">
        <stringToMatch value="test"/>
      <filter type="log4net.Filter.StringMatchFilter">
        <stringToMatch value="error"/>
      <filter type="log4net.Filter.DenyAllFilter"/!-->
      <!--filter type="log4net.Filter.LevelRangeFilter">
        <levelMin value="INFO"/>
        <levelMax value="FATAL"/>
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%utcdate{yyyy-MM-dd HH:mm:ss.fff}	[%6thread]
[%36property{context}]	%-5level	%-35.35logger	%-25method	%message%newline" />
        <!--conversionPattern value="%date PID-%property{pid} TID-%thread %level - %message%newline%exception
%location %logger"/!-->
      <level value="DEBUG"/>
      <appender-ref ref="RollingFileAppender"/>
      <appender-ref ref="ConsoleAppender"/>


C# code:
		static void Main(string[] args)

			for (int i = 0; i < 10; i++)
				Thread worker = new Thread(() =>
						while (true)
							Log.Debug(" This is the debug message!");
							Log.Error(" This is the error message!");
							Log.Info(" This is the info message!");
							Log.Fatal(" This is the fatal message!");
							Log.Warn(" This is the warning message!");

				worker.IsBackground = true;

			for (int i = 0; i < 60; i++)


We had to return to the old version of the log4net dll.

This message was sent by Atlassian JIRA

View raw message