Bug 48986 - RollingFileAppender.rollOver() calls this.setFile with wrong append parameter
Summary: RollingFileAppender.rollOver() calls this.setFile with wrong append parameter
Status: NEW
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-25 14:32 UTC by ommadawn
Modified: 2010-03-25 14:32 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ommadawn 2010-03-25 14:32:17 UTC
I don't understand the reason why the RollingFileAppender.rollOver() method calls this.setFile() with two different "append" values, ignoring the appender's configured fileAppend property.

  First case, if last rename did not succeed (with value true):

      if (!renameSucceeded) {
          try {
            this.setFile(fileName, true, bufferedIO, bufferSize);


   And second case, when all rename-s succeeded (with value false):

    if (renameSucceeded) {
    try {
      // This will also close the file. This is OK since multiple
      // close operations are safe.
      this.setFile(fileName, false, bufferedIO, bufferSize);


I think at least in positive scenario (at second case) it should use the appender's configured value (, what the constructor received), because after first rolling the logfile looses its configured (or default) true value.

Please, correct the code, if You don't have any special reason, because we have annoying sideeffects of that.

Thanks