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/02/04 22:40:30 UTC

DO NOT REPLY [Bug 29726] - DailyRollingFileAppender : log4j:ERROR Failed to rename

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=29726>.
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=29726





------- Additional Comments From patdtaylor2000@yahoo.com  2005-02-04 22:40 -------
Several suggestions on the proposed fix:

Only do the copy/zap if File.renameTo() fails.  Renaming is much cheaper when it
works, particularly if the log file is large.

If both the renaming AND copying fails, the new log file should be opened in
append mode.  This ensures that the existing log messages are not lost.

Be careful about how the copying is done.  It's safer and more efficient to do a
binary copy using a reasonable buffer size rather than try to do a
line-at-a-time text copy.

-- 
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