首页 > 解决方案 > xml config for slf4j java

问题描述

I'm trying to master such a framework, I need to configure it in a maven project by putting a config in the xml resources, where handlers, appenders, etc. will be written. I open the official documentation for the framework (http://www.slf4j.org/manual.html) and I’m looking for how to create this xml, I can’t find it .. Please explain what I’m doing wrong, what is the correct approach to learning frameworks, and how to find an example of this xml config?

标签: javalogging

解决方案


SLF4J is what is called a Facade, or abstraction for multiple logging frameworks. In order to use it, you will have to choose an actual framework, and make sure you have all required dependencies referenced in your pom.xml or gradle.build:

  • selected logging framework ( for example log4j, Java logging, logback etc.)
  • slf4j core
  • slf4j bindings to selected logging framework

XML configuration format is framework specific, so you need to check with the logging framework documentation, for example:


推荐阅读