logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42933] New: - IllegalStateException thrown from FileAppender.closeFile() when log file is actively being tailed
Date Wed, 18 Jul 2007 21:22:40 GMT
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=42933>.
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=42933

           Summary: IllegalStateException thrown from
                    FileAppender.closeFile() when log file is actively being
                    tailed
           Product: Log4j
           Version: 1.2
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: major
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: jake.happs@gdc4s.com
                CC: jake.happs@gdc4s.com


I am using a custom subclass of FileAppender to write log messages to a file.  
If the log file being written is being actively tailed (using 'tail -f') and 
the software calls closeFile() or setFile() (which calls closeFile()) on the 
FileAppender superclass, an IllegalStateException is thrown.  The stack trace 
is included below.  This exception is thrown every time closeFile() or setFile
() are called after the exception is first thrown, even if the active tail has 
been closed.

The partial stack trace is:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Current 
state = FLUSHED, new state = CODING_END
        at java.nio.charset.CharsetEncoder.throwIllegalStateException
(CharsetEncoder.java:941)
        at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:537)
        at sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar
(StreamEncoder.java:358)
        at sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:414)
        at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:160)
        at java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
        at java.io.FilterWriter.close(FilterWriter.java:92)
        at org.apache.log4j.FileAppender.closeFile(FileAppender.java:183)
        at org.apache.log4j.FileAppender.reset(FileAppender.java:338)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:283)
        ...
        ...

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


Mime
View raw message