Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error processing element GELF ([Appenders: null]): CLASS_NOT_FOUND

I am getting the following error in my log4j2.xml file:

Error processing element GELF ([Appenders: null]): CLASS_NOT_FOUND

At first I thought it was because I was referencing an invalid appender, but I still have the error after commenting it out.

Here is what I have:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info" packages="org.graylog2.log4j2">

<Appenders>
    <GELF   name="gelfAppender" 
            server="org.graylog2.log.GelfAppender" 
            port="12201"
            hostName="some.host" 
            facility="GELF-JAVA"
            extractStacktrace="true"
            addExtendedInformation="true">
        <PatternLayout pattern="${some_pattern}"/>
         <!-- Additional fields -->
        <KeyValuePair key="someKey" value="someVal"/>
    </GELF>
</Appenders>
like image 975
mr nooby noob Avatar asked Dec 07 '25 21:12

mr nooby noob


1 Answers

In my case I was missing this dependency in the pom.xml

    <dependency>
        <groupId>org.graylog2.log4j2</groupId>
        <artifactId>log4j2-gelf</artifactId>
        <version>1.3.1</version>
    </dependency>

This article helped me a lot.

like image 73
Azucena H Avatar answered Dec 10 '25 15:12

Azucena H