Bug 1309615 - TCP Syslog handler cannot log some messages after reconnect
TCP Syslog handler cannot log some messages after reconnect
Status: CLOSED NOTABUG
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging (Show other bugs)
6.4.0
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: jboss-set
Nikoleta Ziakova
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-18 04:59 EST by Ondrej Lukas
Modified: 2016-02-19 03:03 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-19 03:03:04 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
logging-deployment (2.46 KB, application/zip)
2016-02-18 05:00 EST, Ondrej Lukas
no flags Details

  None (edit)
Description Ondrej Lukas 2016-02-18 04:59:34 EST
In case when logging to syslog through TCP protocol is configured and syslog port becomes unreachable then after syslog restart some messages can be thrown away. 

It seems syslog handler needs to another two logs for correct closing original TCP connection. In case when syslog is restarted and:
 
- no message is logged during syslog is unreachable then the first two messages will not be logged to syslog after syslog is running again

- one message is attempted to be logged during syslog is unreachable then the first message will not be logged to syslog after syslog is running again

- two and more messages are attempted to be logged during syslog is unreachable then everything is logged correctly after syslog is running again

How to reproduce:
1) Configure EAP to log some category to syslog through TCP:
            <custom-handler name="SYSLOG_TCP_HANDLER" class="org.jboss.logmanager.handlers.SyslogHandler" module="org.jboss.logmanager">
                <encoding value="ISO-8859-1"/>
                <formatter>
                    <pattern-formatter pattern="%-5p [%c] (%t) %s%E%n"/>
                </formatter>
                <properties>
                    <property name="appName" value="JBossEAP"/>
                    <property name="facility" value="LOCAL_USE_5"/>
                    <property name="serverHostname" value="127.0.0.1"/>
                    <property name="hostname" value="-"/>
                    <property name="port" value="10514"/>
                    <property name="syslogType" value="RFC5424"/>
                    <property name="protocol" value="TCP"/>
                    <property name="messageDelimiter" value="-"/>
                    <property name="useMessageDelimiter" value="true"/>
                </properties>
            </custom-handler>
...
            <logger category="org.jboss.as.test.integration.logging.operations">
                <level name="INFO"/>
                <handlers>
                    <handler name="SYSLOG_TCP_HANDLER"/>
                </handlers>
            </logger>
2) Start application server and syslog server.
3) Deploy logging servlet (see attachements) which makes one log when is accessed.
4) Access http://127.0.0.1:8080/logging-deployment/logger -> message is logged to syslog
5) Restart Syslog server
6) Access http://127.0.0.1:8080/logging-deployment/logger three times -> first and second message are thrown away, only third message is logged
7) Stop Syslog server
8) Access http://127.0.0.1:8080/logging-deployment/logger twice (messages are not logged to syslog since it is down)
9) Start Syslog server
10) Access http://127.0.0.1:8080/logging-deployment/logger -> message is logged to syslog
Comment 1 Ondrej Lukas 2016-02-18 05:00 EST
Created attachment 1128172 [details]
logging-deployment
Comment 2 Ondrej Lukas 2016-02-19 03:03:04 EST
According to https://issues.jboss.org/browse/WFCORE-1401 this is expected behavior -> CLOSED as NOTABUG.

Note You need to log in before you can comment on or make changes to this bug.