slf4j + java.util.logging:如何配置? [英] slf4j + java.util.logging: how to configure?

查看:188
本文介绍了slf4j + java.util.logging:如何配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用slf4j + java.util.logging。我知道如何设置Java源代码来通过 logger = LoggerFactory.getLogger(...) logger.warn('。 ..')或其他什么。

I'm trying to use slf4j + java.util.logging. I know how to set up the Java source code to do this via logger = LoggerFactory.getLogger(...) and logger.warn('...') or whatever.

但是在slf4j中设置配置的文档在哪里?我'我很困惑...我有log4j手册,熟悉日志适配器的基础知识,但我不知道如何使用slf4j + java.util.logging。

But where's the documentation for setting up the configuration in slf4j? I'm very confused... I have the log4j manual and am familiar w/ the very basics of logging adapters, but I'm just not sure how to get this to work with slf4j + java.util.logging.

即:


  • .properties文件和/或JVM -D 命令行参数我是否需要指定将其指向我的配置文件?

  • which .properties file and/or JVM -D command-line argument do I need to specify to point it at my configuration file?

其中的文档是java.util.logging的配置文件?

where's the documentation for the configuration file for java.util.logging?

使用slf4j会导致配置文件发生任何变化吗? (即我必须以不同的方式声明,而不是直接使用java.util.logging或log4j)

does using slf4j cause any change in my configuration file? (i.e. something that I would have to declare differently, vs. just using java.util.logging or log4j directly)

推荐答案

请参阅本教程jul


java -Djava.util.logging.config.file = myLoggingConfigFilePath

java -Djava.util.logging.config.file=myLoggingConfigFilePath

但我建议去 Logback

这篇关于slf4j + java.util.logging:如何配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆