Search code examples
javaslf4jgraylog2grayloggelf

Sending logs to Graylog and in Gelf format


I would like to use graylog as central logging server and currently I am just using slf4j Logger "slf4j-api" as Java logging framework for logging in my java application. Can i use SLF4J to send logging to Graylog? or Which additional libraries do i need to send these logs to Graylog?


Solution

  • SLF4J is just a facade for other logging libraries.

    You have to use a GELF appender for the specific logging framework (Log4j, Logback, java.util.logging, etc.) you're using in your application.

    Check out the Graylog Marketplace for existing GELF appenders for Java logging frameworks:

    https://marketplace.graylog.org/addons?tag=java