Log4net
  1. Log4net
  2. LOG4NET-369

preserveLogFileNameExtension is not considered when rolling over time after an application restart

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.9
    • Fix Version/s: 1.2.12
    • Component/s: Appenders
    • Labels:
      None

      Description

      Consider this configuration, with V 1.2.11 or trunk:

      <file value="log.log" />
      <appendToFile value="true" />
      <rollingStyle value="Composite" />
      <datePattern value=".yyyyMMdd-HHmm" />
      <staticLogFileName value="true" />
      <preserveLogFileNameExtension value="true" />

      • Start an application (a verbose one, preferably) with it.
      • Kill it immediately.
        Log directory now looks like this

        log.log
      • Wait until we are in another minute
      • Start application again
      • Kill it immediately
        Log directory now looks like this

        log.log
        log.log.20130122-2042

      Didn't we say we want to preserveLogFileNameExtension?
      Shouldn't the file name of the file rolled over be "log.20130122-2042.log"?
      If the application weren't killed and restarted in another period,
      everything were correct.

      This happens when rolling over an old log file from a previous run upon application start. The line of this patch fixes it.

        Issue Links

          Activity

            People

            • Assignee:
              Dominik Psenner
              Reporter:
              Dominik Psenner
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development