Bug 51164

Summary: log4j should not dump errors to stdout on interrupt
Product: Log4j - Now in Jira Reporter: eschrock <eschrock1>
Component: OtherAssignee: log4j-dev <log4j-dev>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Solaris   

Description eschrock 2011-05-06 20:33:54 UTC
In our environment, we make heavy use of log4j (1.2.15), as well as async threads that are canceled through interrupt().  Every so often, we get the following spam dumped to stdout:

java.io.InterruptedIOException
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:260)
    at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
    at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
    at org.apache.log4j.helpers.QuietWriter.flush(QuietWriter.java:58)
    ...

This is superflous and misleading. InterruptedIOException is a perfectly legitimate occurrence in a complex environment; there's no reason to assume that a) it is an error and b) it is OK to dump messages to stdout in arbitrary context.