Logging with Gelf

441 views
Skip to first unread message

Jan Strube

unread,
Aug 23, 2017, 8:19:57 AM8/23/17
to WildFly Swarm
Hi,

has anyone managed using gelf as logging handler?

I added this to project-stages.yml:

swarm:
    logging
:
        root
-logger:
            level
: INFO
        custom
-handlers:
            GELF
:
                level
: DEBUG
                attribute
-class: biz.paluch.logging.gelf.wildfly.WildFlyGelfLogHandler
               
module: biz.paluch.logging
                properties
:
                    host
: udp:localhost
        loggers
:
            com
.foo:
              level
: DEBUG
              handlers
:
                 
- GELF

and to pom.xml:

<dependency>
   
<groupId>biz.paluch.logging</groupId>
   
<artifactId>logstash-gelf</artifactId>
   
<version>1.11.1</version>
   
<classifier>logging-module</classifier>
</dependency>

But I get an:

ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
   
("subsystem" => "logging"),
   
("custom-handler" => "GELF")
]): java.lang.IllegalArgumentException: WFLYLOG0019: Failed to load module 'biz.paluch.logging' for handler 'GELF'

Thanks
Jan

Ken Finnigan

unread,
Aug 23, 2017, 9:38:53 AM8/23/17
to WildFly Swarm
Jan,

Does your project have a module.xml for biz.paluch.logging in src/main/resources/modules of the project?

If not, that's likely the cause.

Essentially there needs to be a module.xml to map the Maven dependency to a JBoss Module, which is the name you need to set on GELF.module in the yaml.

Take a look at https://github.com/wildfly-swarm/wildfly-swarm-examples/tree/master/datasource/datasource-war for an example of providing module.xml files.

Ken

Jan Strube

unread,
Aug 24, 2017, 3:15:55 AM8/24/17
to WildFly Swarm
Hi Ken,

 
Does your project have a module.xml for biz.paluch.logging in src/main/resources/modules of the project?

argh! It has, buit I called it modules.xml.

Thanks a lot
Jan

Thomas Herzog

unread,
Sep 8, 2018, 7:59:24 AM9/8/18
to Thorntail
How did you achive this, because I get the following error, when I integrate it as you described.

2018-09-08 09:50:36,826 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "logging"),
    ("custom-handler" => "GELF")
]) - failure description: "WFLYLOG0021: Class 'biz.paluch.logging.gelf.wildfly.WildFlyGelfLogHandler' could not be found."

Thorntail: 2.1.0.Final
logstash-gelf: 1.12.0
modules/biz/paluch/logging/main/module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module name="biz.paluch.logging" xmlns="urn:jboss:module:1.3">
    <resources>
        <resource-root path="logstash-gelf-1.11.2.jar"/>
        <resource-root path="jedis-2.9.0.jar"/>
        <resource-root path="commons-pool2-2.4.3.jar"/>
    </resources>
    <dependencies>
        <module name="org.apache.log4j"/>
        <module name="org.slf4j"/>
        <module name="javax.api"/>
        <module name="org.jboss.logmanager"/>
    </dependencies>
</module>

Thomas Herzog

unread,
Sep 10, 2018, 3:31:49 AM9/10/18
to Thorntail
Reply all
Reply to author
Forward
0 new messages