just started to get into Graylog2 and wanted to log some Java-Applications via GELF Input. Therefore I used the library log4j2 and added the graylog2-gelfclient. All dependencies are satisfied and the programm is running. But the initialisation of my Logmanager is throwing the following error:
ERROR StatusLogger appenders contains an invalid element or attribute "GELF"
My code is just logging an error to the logger:
static final Logger logger = LogManager.getLogger(Application.class);
public static void main(String[] args) {
logger.error("This is an error log entry");
}
}
and my log4j2.xml file is configured to use GELF and the GelfAppender:
<configuration status="OFF">
<appenders>
<GELF name="gelfAppender" server="192.168.1.1" port="12201" hostName="myhost"/>
</appenders>
<loggers>
<root level="info">
<appender-ref ref="gelfAppender"/>
</root>
</loggers>
</configuration>
Is anyone familiar with this problem? Thanks for any help.