Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

WildFlyGelfLogHandler does not honor "enabled" attribute of <custom-handler> #170

Closed
HonoluluHenk opened this issue Dec 11, 2018 · 2 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@HonoluluHenk
Copy link

HonoluluHenk commented Dec 11, 2018

Testcase

<custom-handler name="Some-Graylog"
                            class="biz.paluch.logging.gelf.wildfly.WildFlyGelfLogHandler"
                            module="biz.paluch.logging"
                            enabled="false">
  <level name="INFO" />
  <!-- other settings do not matter -->
</custom-handler>

Even though the attribute "enabled" is set to "false", I see logs if there's nothing listening on localhost:12201:
LogManager error of type GENERIC_FAILURE: Connection refused
java.io.IOException: Cannot send data to localhost:12200

A first glance into the WildFlyGelfLogHandler.java Source does not show anything about reading the "enabled" attribute

Full Error stack:

19:23:56,490 INFO  [org.jboss.as.connector] (MSC service thread 1-5) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.6.Final)
LogManager error of type GENERIC_FAILURE: Connection refused
java.io.IOException: Cannot send data to localhost:12200
	at biz.paluch.logging.gelf.intern.sender.GelfTCPSender.sendMessage(GelfTCPSender.java:126)
	at biz.paluch.logging.gelf.jul.GelfLogHandler.publish(GelfLogHandler.java:134)
	at biz.paluch.logging.gelf.wildfly.WildFlyGelfLogHandler.publish(WildFlyGelfLogHandler.java:83)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:314)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322)
	at org.jboss.logmanager.Logger.logRaw(Logger.java:850)
	at org.jboss.logmanager.Logger.log(Logger.java:802)
	at org.jboss.logging.JBossLogManagerLogger.doLogf(JBossLogManagerLogger.java:53)
	at org.jboss.logging.Logger.logf(Logger.java:2398)
	at org.jboss.as.jaxrs.logging.JaxrsLogger_$logger.resteasyVersion(JaxrsLogger_$logger.java:129)
	at org.jboss.as.jaxrs.JaxrsSubsystemAdd.performBoottime(JaxrsSubsystemAdd.java:60)
	at org.jboss.as.controller.AbstractBoottimeAddStepHandler.performRuntime(AbstractBoottimeAddStepHandler.java:116)
	at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:151)
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:980)
	at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:726)
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:450)
	at org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:386)
19:23:56,427 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 35) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
19:23:56,480 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 49) WFLYSEC0002: Activating Security Subsystem
	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.net.ConnectException: Connection refused
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
	at biz.paluch.logging.gelf.intern.sender.GelfTCPSender.connect(GelfTCPSender.java:164)
	at biz.paluch.logging.gelf.intern.sender.GelfTCPSender.sendMessage(GelfTCPSender.java:103)
	... 23 more
@HonoluluHenk
Copy link
Author

I created a pull request with a fix: 13c29ae

@mp911de mp911de added the type: bug A general bug label Dec 12, 2018
@mp911de mp911de added this to the 1.12.2 milestone Dec 12, 2018
mp911de pushed a commit that referenced this issue Dec 14, 2018
Honor now "enabled" attribute of <custom-handler>.

Original pull request: #171.
mp911de added a commit that referenced this issue Dec 14, 2018
Add enabled property to JBoss7GelfLogHandler to mirror a consistent API. Add documentation. Reformat code. Drop WildFlyHandlerDisabledIntegrationTests.

Original pull request: #171.
mp911de pushed a commit that referenced this issue Dec 14, 2018
Honor now "enabled" attribute of <custom-handler>.

Original pull request: #171.
mp911de added a commit that referenced this issue Dec 14, 2018
Add enabled property to JBoss7GelfLogHandler to mirror a consistent API. Add documentation. Reformat code. Drop WildFlyHandlerDisabledIntegrationTests.

Original pull request: #171.
@mp911de mp911de added type: enhancement A general enhancement and removed type: bug A general bug labels Dec 14, 2018
@mp911de
Copy link
Owner

mp911de commented Dec 18, 2018

Thanks a lot. Solved via #171.

@mp911de mp911de closed this as completed Dec 18, 2018
@mp911de mp911de modified the milestones: 1.12.2, 1.13.0 Feb 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants