【发布时间】:2017-02-16 15:21:10
【问题描述】:
我想在我的 Vert.x 应用程序中更改默认日志级别,所以我在项目中添加了一个名为 vertx-default-jul-logging.properties 的配置文件,然后添加其根文件夹作为类路径中的源文件夹,just like the documentation says。
文件有这样的内容:
handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler
java.util.logging.SimpleFormatter.format=%5$s %6$s\n
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.level=FINEST
java.util.logging.FileHandler.level=INFO
java.util.logging.FileHandler.formatter=io.vertx.core.logging.impl.VertxLoggerFormatter
# Put the log in the system temporary directory
java.util.logging.FileHandler.pattern=%t/vertx.log
.level=FINEST
io.vertx.ext.web.level=FINEST
io.vertx.level=FINEST
com.hazelcast.level=FINEST
io.netty.util.internal.PlatformDependent.level=FINEST
现在...这些都不起作用,日志级别没有改变一点;我看不到任何调试痕迹。
我做错了什么?
【问题讨论】:
-
您是否将此文件放入您的
src/main/resources中?试过了,效果很好。 -
我遇到了同样的问题。使用
ch.qos.logback包并在 src/main/resources/ 中拥有类似的配置文件,只需不断从 io.netty 获取 DEBUG 日志记录