You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2005/04/08 11:40:50 UTC

DO NOT REPLY [Bug 31458] - DailyRollingFileAppender fails with mult load-balancing JVMs under WAS

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31458>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31458


peter@ibuildings.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter@ibuildings.nl




------- Additional Comments From peter@ibuildings.nl  2005-04-08 11:40 -------
We are experiencing this issue too. I've looked at the sources of
DailyRollingFileAppender.java and I think this can easily be fixed by changing
the rollOver method. Instead of the following code:

  File target  = new File(scheduledFilename);
  if (target.exists()) {
    target.delete();
  }

  File file = new File(fileName);
  boolean result = file.renameTo(target);
  if(result) {
    LogLog.debug(fileName +" -> "+ scheduledFilename);
  } else {
    LogLog.error("Failed to rename ["+fileName+"] to ["+scheduledFilename+"].");
  }

The following code:

  File target  = new File(scheduledFilename);
  if (!target.exists()) {
    File file = new File(fileName);
    boolean result = file.renameTo(target);
    if(result) {
      LogLog.debug(fileName +" -> "+ scheduledFilename);
    } else {
      LogLog.error("Failed to rename ["+fileName+"] to ["+scheduledFilename+"].");
    }
  }

Maybe behind an option so that the user can choose for the (old) delete
behaviour and the new behaviour.

Will this be incorporated in a future version of Log4J?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org