java - 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?
解决方案
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:
推荐阅读
- r - 错误:执行“console_input”时 RStudio 服务器返回状态码 500
- batch-file - 批处理(选择):ERRORLEVEL 似乎不起作用
- python - Teradatasql Python:无法传递列名
- c++ - 服务器与不同的套接字端口连接
- php - 如何从右侧剪切字符串的一部分并将其返回?
- python - 当我编写代码以提供视频转发选项时,Django 网页出现 404 错误
- javascript - 将href zip_中的字符替换为zip
- python - pygame 中用于 MOUSEBUTTONDOWN/MOUSEBUTTONUP 检测的嵌套事件循环
- r - R parSapply 无法识别该函数
- javascript - React Native API 调用和提取变量