-5

How to use slf4j with graylog as a wrapper ? we can use log4j with slf4j. I am looking for a good graylog framework can any please say can we use graylog with slf4j ?

Spark-Beginner
  • 1,334
  • 5
  • 17
  • 24

2 Answers2

6

It's not entirely clear what you're asking. SLF4J is a logging API. Log4j and Logback are implementations of that API (Log4j is also a standalone logging framework, of course). Graylog is a log aggregator.

If you want to use SLF4J to send logging to Graylog, you will need an implementation that can somehow send log messages over syslog in Graylog's GELF format. I don't know of any implementation which does that natively, but there are extensions for both Logback and Log4j to do this:

Tom Anderson
  • 46,189
  • 17
  • 92
  • 133
2

Logback is intended as a successor to the popular log4j project. logback-classic natively implements the SLF4J API.

about logback and Graylog2, pleade read https://github.com/Moocar/logback-gelf

fatmind
  • 21
  • 4