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 ?
            Asked
            
        
        
            Active
            
        
            Viewed 3,844 times
        
    -5
            
            
        - 
                    2So is it about logback or graylog? – Andrei Nicusan Nov 15 '13 at 13:05
 
2 Answers
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:
- https://github.com/Moocar/logback-gelf for Logback
 - https://github.com/t0xa/gelfj for Log4j
 
        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