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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With