Log4net
  1. Log4net
  2. LOG4NET-188

RollingFileAppender log.1, log.2 are not being rolled by Date

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 1.2.10
    • Component/s: Appenders
    • Labels:
      None
    • Environment:
      .NET 2005, Microsoft Windows Server 2003

      Description

      I am using log4net.dll v1.2.0.30714. My RollingFileAppender rolls only the .log file every day but ignores the log.1, log.2 etc...
      This is only happening on my Web Service. My Windows Service project does not have this problem. It works fine with the same log4net.dll version.
      I credted the log4net.txt. I am attaching a section of it below:
      Note: By looking at the RollingFileAppeder.cs, If StaticLogFileName=true, "it is from a different date period" should not appear. Am I wrong on this?

      log4net: DOMConfigurator: Loading Appender [RollingLogFileAppender] type: [log4net.Appender.RollingFileAppender]
      log4net: DOMConfigurator: Setting Property [File] to String value [D:\Apps\Agents\GFS\Strategyware\EnterpriseMQServices\Logs\Activity.log]
      log4net: DOMConfigurator: Setting Property [AppendToFile] to Boolean value [True]
      log4net: DOMConfigurator: Setting Property [DatePattern] to String value [.MM-dd-yyyy".log"]
      log4net: DOMConfigurator: Setting Property [RollingStyle] to RollingMode value [Composite]
      log4net: DOMConfigurator: Setting Property [MaxSizeRollBackups] to Int32 value [20]
      log4net: DOMConfigurator: Setting Property [MaximumFileSize] to String value [15MB]
      log4net: DOMConfigurator: Setting Property [StaticLogFileName] to Boolean value [True]
      log4net: DOMConfigurator: Setting Property [ConversionPattern] to String value [%d [%t] %-5p %c [%x] - %m%n]
      log4net: DOMConfigurator: Setting Property [Layout] to object [log4net.Layout.PatternLayout]
      log4net: RollingFileAppender: Type = [0], r0 = [.12-31-1969.log], r1 = [.12-31-1969.log]
      log4net: RollingFileAppender: Type = [1], r0 = [.12-31-1969.log], r1 = [.12-31-1969.log]
      log4net: RollingFileAppender: Type = [2], r0 = [.12-31-1969.log], r1 = [.01-01-1970.log]
      log4net: RollingFileAppender: Searching for existing files in [D:\Apps\Agents\GFS\Strategyware\EnterpriseMQServices\Logs]
      log4net: RollingFileAppender: Ignoring file [activity.log.1] because it is from a different date period
      log4net: RollingFileAppender: Ignoring file [activity.log.2] because it is from a different date period
      log4net: RollingFileAppender: Ignoring file [activity.log.3] because it is from a different date period
      log4net: RollingFileAppender: Ignoring file [activity.log.4] because it is from a different date period

        Activity

        Hide
        Ron Grabowski added a comment -

        If its working fine on one project but not in another I don't think its a Major bug in the log4net codebase. Can you post your log4net.config file to the mailing list so others can try to duplicate your issue.

        Show
        Ron Grabowski added a comment - If its working fine on one project but not in another I don't think its a Major bug in the log4net codebase. Can you post your log4net.config file to the mailing list so others can try to duplicate your issue.
        Hide
        Gulden Yazgan added a comment - - edited

        I don't have log4Net.config. I have log4net.xml on the same folder.

        Show
        Gulden Yazgan added a comment - - edited I don't have log4Net.config. I have log4net.xml on the same folder.
        Hide
        Ron Grabowski added a comment -

        Does it work when you use a simple datePattern like: MM-dd-yyyy?

        The issue of log4net not preserving the file extension has been fixed in the SVN.

        Show
        Ron Grabowski added a comment - Does it work when you use a simple datePattern like: MM-dd-yyyy? The issue of log4net not preserving the file extension has been fixed in the SVN.
        Hide
        Ron Grabowski added a comment -

        You mentioned the rolling works fine in one project but not the other which leads me to believe that there is a problem with your configuration. There have been improvements to the RollingFileAppender. Try running your code against the latest versison and re-open this ticket if you're still having issues.

        Show
        Ron Grabowski added a comment - You mentioned the rolling works fine in one project but not the other which leads me to believe that there is a problem with your configuration. There have been improvements to the RollingFileAppender. Try running your code against the latest versison and re-open this ticket if you're still having issues.

          People

          • Assignee:
            Unassigned
            Reporter:
            Gulden Yazgan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development