using Logback with slf4j [closed]

六月ゝ 毕业季﹏ 提交于 2019-12-13 11:28:33

问题


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 ?


回答1:


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



回答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



来源:https://stackoverflow.com/questions/20001739/using-logback-with-slf4j

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!