Log4net
  1. Log4net
  2. LOG4NET-280

Rolling appender doesnt roll 0kb file, configured to roll on date.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.2 Maintenance Release
    • Component/s: Appenders
    • Labels:
      None
    • Environment:
      asp.net 2.0

      Description

      We are using a log4net version 1.2.10.1. We have a web application in which we are using log4net rolling appender for application logging.
      However the files which are 0Kb is not rolling on a daily basis. Below is the configuration we are using. It's configured to roll on a date basis.

      The logs which are >0kb are rolling fine.

      <appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="D:\LogFiles\abc\abc_"/>
      <param name="AppendToFile" value="true"/>
      <param name="RollingStyle" value="Date"/>
      <param name="DatePattern" value="yyyyMMdd.LOG"/>
      <param name="staticLogFileName" value="false"/>
      <param name="ImmediateFlush" value="true"/>
      <layout type="log4net.Layout.PatternLayout">
      <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
      </layout>
      <filter type="log4net.Filter.LevelRangeFilter">
      <param name="LevelMin" value="DEBUG"/>
      <param name="LevelMax" value="FATAL"/>
      </filter>
      </appender>
      <logger name="FileLogger">
      <level value="INFO"/>
      <appender-ref ref="FileAppender"/>
      </logger>

      Any help ASAP will be appreciated.

        Issue Links

          Activity

          Naveen Jakkur Muniraju created issue -
          Naveen Jakkur Muniraju made changes -
          Field Original Value New Value
          Description We are using a log4net version 1.2.10.1. We have a web application in which we are using log4net rolling appender for application logging.
          However the files which are 0Kb is not rolling on a daily basis. Below is the configuration we are using. It's configured to roll on a date basis.
          <appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
          <param name="File" value="D:\LogFiles\abc\abc_"/>
          <param name="AppendToFile" value="true"/>
          <param name="RollingStyle" value="Date"/>
          <param name="DatePattern" value="yyyyMMdd.LOG"/>
          <param name="staticLogFileName" value="false"/>
          <param name="ImmediateFlush" value="true"/>
          <layout type="log4net.Layout.PatternLayout">
          <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
          </layout>
          <filter type="log4net.Filter.LevelRangeFilter">
          <param name="LevelMin" value="DEBUG"/>
          <param name="LevelMax" value="FATAL"/>
          </filter>
          </appender>
          <logger name="FileLogger">
          <level value="INFO"/>
          <appender-ref ref="FileAppender"/>
          </logger>
          We are using a log4net version 1.2.10.1. We have a web application in which we are using log4net rolling appender for application logging.
          However the files which are 0Kb is not rolling on a daily basis. Below is the configuration we are using. It's configured to roll on a date basis.

          The logs which are >0kb are rolling fine.

          <appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
          <param name="File" value="D:\LogFiles\abc\abc_"/>
          <param name="AppendToFile" value="true"/>
          <param name="RollingStyle" value="Date"/>
          <param name="DatePattern" value="yyyyMMdd.LOG"/>
          <param name="staticLogFileName" value="false"/>
          <param name="ImmediateFlush" value="true"/>
          <layout type="log4net.Layout.PatternLayout">
          <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
          </layout>
          <filter type="log4net.Filter.LevelRangeFilter">
          <param name="LevelMin" value="DEBUG"/>
          <param name="LevelMax" value="FATAL"/>
          </filter>
          </appender>
          <logger name="FileLogger">
          <level value="INFO"/>
          <appender-ref ref="FileAppender"/>
          </logger>

          Any help ASAP will be appreciated.
          Stefan Bodewig made changes -
          Fix Version/s 1.2 Maintenance Release [ 12317606 ]
          Roy Chastain made changes -
          Assignee Roy Chastain [ roy@sohotech.biz ]
          Roy Chastain made changes -
          Assignee Roy Chastain [ roy@sohotech.biz ]
          Hide
          Dominik Psenner added a comment -

          I maybe understood why this doesn't work:

          If there are no events to be handled by the appender, the rolling algorithm is never invoked and thus the file won't be rolled until there's a logging event to be written into that file. To implement this feature, we would require a worker thread that is synchronized with the appender. Is this really worth the effort?

          Show
          Dominik Psenner added a comment - I maybe understood why this doesn't work: If there are no events to be handled by the appender, the rolling algorithm is never invoked and thus the file won't be rolled until there's a logging event to be written into that file. To implement this feature, we would require a worker thread that is synchronized with the appender. Is this really worth the effort?
          Dominik Psenner made changes -
          Link This issue is duplicated by LOG4NET-240 [ LOG4NET-240 ]
          Dominik Psenner made changes -
          Link This issue is superceded by LOG4NET-367 [ LOG4NET-367 ]
          Dominik Psenner made changes -
          Priority Blocker [ 1 ] Minor [ 4 ]
          Hide
          Dominik Psenner added a comment -

          Decreased priority to Minor since there was no interest in this issue for two years.

          Show
          Dominik Psenner added a comment - Decreased priority to Minor since there was no interest in this issue for two years.

            People

            • Assignee:
              Unassigned
              Reporter:
              Naveen Jakkur Muniraju
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 672h
                672h
                Remaining:
                Remaining Estimate - 672h
                672h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development