Bug 51164 - log4j should not dump errors to stdout on interrupt
Summary: log4j should not dump errors to stdout on interrupt
Status: NEW
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Solaris
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 20:33 UTC by eschrock
Modified: 2011-05-06 20:33 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.