今天试用了JDK自带的Logger

配置文件可以这样写:

handlers=java.util.logging.ConsoleHandler

.level=<font color=red> ALL</font>

java.util.logging.ConsoleHandler.level = <font color=red>ALL</font>

java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

jdk的logging将日志分为七个级别,详细我就不列了

要修改日志级别,需要将上面两处红色的地方都替换掉

带LOG运行的方法是:

java.exe <b>-Djava.util.logging.config.file=loggingfile.properties</b>  SomeClass

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.