History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LBCORE-73
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Logback dev list
Reporter: Paul Nyheim
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
logback-core

Add option to make <consolePlugin/> fail silently if no SocketServer is running

Created: 18/Nov/08 10:42 AM   Updated: 18/Nov/08 12:26 PM
Component/s: Appender
Affects Version/s: 0.9.11
Fix Version/s: None

File Attachments: 1. Text File consolePlugin-silentMode.patch (4 kb)



 Description  « Hide
For my JUnit tests, I have configured a logback-test.xml file with only a <consolePlugin/> entry. (debug=false)
However, when I run the tests on the build-server, I get the following printed to System.out:

09:02:23,596 |-ERROR in ch.qos.logback.classic.net.SocketAppender[null] - Could not connect to remote logback server at [localhost]. We will try again later.
java.net.ConnectException: Connection refused: connect
       at java.net.ConnectException: Connection refused: connect
       at at java.net.PlainSocketImpl.socketConnect(Native Method)
       at at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
       at at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

I realize that this message is part of logbacks internal status, however it would be nice to have the option to disable this message which pollutes the build-log on the build-server. Maybe by specifying an attribute like this: <consolePlugin silent="true"/> where the underlying Socketappender will be silent if it is not able to connect to the host and port.

I'll see if I can upload a patch later today.
Regards,
Paul Nyheim

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Paul Nyheim - 18/Nov/08 12:26 PM
Patch made against the Release 0.9.11 tag.
Adds silent attribute to <consolePlugin /> so that socketappender does not print ConnectException when no server is listening on server:port