Hello everyone,

i am trying to configure a java webapp which is using log4j2, that it logs 
against graylog2.

This is my log4j2.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn">
  <Appenders>
    <GELF name="gelfAppender" server="localhost" port="12201" 
hostName="appserver" ignoreExceptions="false"/>
  </Appenders>
<Loggers>
    <Root level="warn">
      <AppenderRef ref="gelfAppender"/>
    </Root>
  </Loggers>
</Configuration>

I have added the corresponding java libraries (log4j-api, log4j-core, 
log4j2-gelf, log4j-nosql and their dependencies) to the classpath.
Further i installed the graylog2 infrastructure on my system using the 
quickstart installer which seems to have worked correctly.
Then i added an input of type "GELF TCP" with following configuration 
options: 

port: 12201
bind_address: 0.0.0.0
recv_buffer_size: 1048576

When i now start my system, i get the following exception

org.apache.logging.log4j.core.appender.AppenderLoggingException: Attempted 
to append to non-started appender gelfAppender
at 
org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:87)
at 
org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:428)
at 
org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:407)
at 
org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:365)
at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:112)
at org.apache.logging.slf4j.Log4jLogger.log(Log4jLogger.java:374)
at 
org.apache.commons.logging.impl.SLF4JLocationAwareLog.error(SLF4JLocationAwareLog.java:225)
at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:331)
at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

I can't find the error in there and would be glad someone of you can figure 
out

Best Regards
Christian

-- 
You received this message because you are subscribed to the Google Groups 
"graylog2" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to