Bug 44834 - SimpleSocketServer looses buffered logs, produces spurious error on exit.
Summary: SimpleSocketServer looses buffered logs, produces spurious error on exit.
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.2
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
Depends on:
Reported: 2008-04-17 10:51 UTC by Bernard Stumpf
Modified: 2008-08-12 10:04 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Bernard Stumpf 2008-04-17 10:51:11 UTC
Running SimpleSocketServer.java receiving logs from other nodes, configured via XML, using RollingFileAppender with "BufferedIO" value="true", "BufferSize" value="65536", upon socket close from the sending side the buffered logs are lost.

Since SimpleSocketServer is a main program it is responsible for calling LogManager::shutdown() as stated in the log4j documentation.

The lost logs problem is easily corrected by reconfiguring to do "BufferedIO" value="false", but that defeats the performance purpose of buffering on the server side.

The spurious error on exit was:

2008-04-15 18:16:19,410 [Thread-0] INFO  org.apache.log4j.net.SocketNode (org.apache.log4j.net.SocketNode.run(SocketNode.java:89)) - Caught java.io.EOFException closing conneciton.

Note also the misspelled "conneciton" in SocketNode.java (in three places)
Comment 1 Thorbjørn Ravn Andersen 2008-08-02 15:55:38 UTC
Can you create a test case demonstrating this behaviour, please?