Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-97

Log file in archive created by RollingFileAppender does not have an extension

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • logback-core
    • None
    • Windows XP

    Description

      When creating a rolling file appender (see configuration below), the log file within the zipped archive has no extension. This is quite annoying on a Windows system since Windows has no clue how to open a file without extension. You have to rename the file and add the correct extension or choose the program to open over and over again.

      Suggested fix: make the file in the archive inherit the extension from the original log file. So for an archive named "log-2010-08-11.zip", the log file within the archive would become "log-2010-08-11.txt", since the original log file was "log.txt".

      <appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <file>log.txt</file>
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>log-%d

      {yyyy-MM-dd}

      .zip</fileNamePattern>
      <maxHistory>60</maxHistory>
      </rollingPolicy>
      <encoder>
      <pattern>%-4relative [%thread] %-5level %logger

      {35}

      - %msg%n</pattern>
      </encoder>
      </appender>

      Attachments

        Activity

          People

            logback-dev Logback dev list
            stijn.van.bael Stijn Van Bael
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: