QOS.ch JIRA

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • logback-core
  • LBCORE-98

TimeBasedRollingPolicy: name of file in zip archive is <FileNamePattern>.nanos.tmp

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 0.9.15
  • Fix Version/s: 0.9.18
  • Component/s: Rolling
  • Labels:
    None
  • Environment:
    Windows

Description

The name of the filename in the zip archive is a temp filename, based on the FileNamePattern, no the FileNamePattern itself.
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    LBCORE-98.patch
    12/Aug/09 4:42 AM
    2 kB
    Anders Wallgren
  2. Text File
    LBCORE-98.patch
    10/Jun/09 11:23 PM
    4 kB
    Anders Wallgren

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
Hide
Permalink
Anders Wallgren added a comment - 10/Jun/09 10:57 PM
Based on this code:

  boolean rolloverTargetIsParentFile() {
    return (getParentsRawFileProperty() != null && getParentsRawFileProperty()
        .equals(elapsedPeriodsFileName));
  }

  public void rollover() throws RolloverFailure {

    // when rollover is called the elapsed period's file has
    // been already closed. This is a working assumption of this method.
    
    if(compressionMode == CompressionMode.NONE) {
      if (getParentsRawFileProperty() != null) {
        util.rename(getParentsRawFileProperty(), elapsedPeriodsFileName);
      }
    } else {
      if(getParentsRawFileProperty() == null) {
        doCompression(false, elapsedPeriodsFileName, elapsedPeriodsFileName);
      } else {
        doCompression(true, elapsedPeriodsFileName, elapsedPeriodsFileName);
      }
    }
    
    if (tbCleaner != null) {
      tbCleaner.clean(new Date(getCurrentTime()));
    }
  }

and the fact that rolloverTargetIsParentFile is unused, it looks like the intent may have been to only archive the tempfile if the target and parent file names collide.
Show
Anders Wallgren added a comment - 10/Jun/09 10:57 PM Based on this code:   boolean rolloverTargetIsParentFile() {     return (getParentsRawFileProperty() != null && getParentsRawFileProperty()         .equals(elapsedPeriodsFileName));   }   public void rollover() throws RolloverFailure {     // when rollover is called the elapsed period's file has     // been already closed. This is a working assumption of this method.          if(compressionMode == CompressionMode.NONE) {       if (getParentsRawFileProperty() != null) {         util.rename(getParentsRawFileProperty(), elapsedPeriodsFileName);       }     } else {       if(getParentsRawFileProperty() == null) {         doCompression(false, elapsedPeriodsFileName, elapsedPeriodsFileName);       } else {         doCompression(true, elapsedPeriodsFileName, elapsedPeriodsFileName);       }     }          if (tbCleaner != null) {       tbCleaner.clean(new Date(getCurrentTime()));     }   } and the fact that rolloverTargetIsParentFile is unused, it looks like the intent may have been to only archive the tempfile if the target and parent file names collide.
Hide
Permalink
Anders Wallgren added a comment - 12/Aug/09 4:42 AM
A slightly different patch, based on 0.9.17.

Patch ch.qos.logback.core.rolling.helper.Compressor to use the name of the archive, minus ".zip" as the name of the zip entry, rather than the .tmp file.
Show
Anders Wallgren added a comment - 12/Aug/09 4:42 AM A slightly different patch, based on 0.9.17. Patch ch.qos.logback.core.rolling.helper.Compressor to use the name of the archive, minus ".zip" as the name of the zip entry, rather than the .tmp file.
Hide
Permalink
Ceki Gulcu added a comment - 13/Nov/09 10:40 AM
Thank you for reporting and proving a patch for this issue. Your second patch has been applied with some adjustment. For the most part, it was right on. The only required change was the removal of any eventual folder prefix in the zipped file name. See also

http://github.com/ceki/logback/commit/feba37d06ec4fc8398641b3056f32e1afdcb0bb4
Show
Ceki Gulcu added a comment - 13/Nov/09 10:40 AM Thank you for reporting and proving a patch for this issue. Your second patch has been applied with some adjustment. For the most part, it was right on. The only required change was the removal of any eventual folder prefix in the zipped file name. See also http://github.com/ceki/logback/commit/feba37d06ec4fc8398641b3056f32e1afdcb0bb4

People

  • Assignee:
    Ceki Gulcu
    Reporter:
    Anders Wallgren
Vote (0)
Watch (1)

Dates

  • Created:
    10/Jun/09 10:45 PM
    Updated:
    13/Nov/09 10:40 AM
    Resolved:
    13/Nov/09 10:40 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for logback. Try JIRA - bug tracking software for your team.