且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在log4j中启用程序包级别的日志记录

更新时间:2022-05-23 04:16:19

包级别日志记录是log4j的标准日志记录.通过log4j配置,您可以指定软件包和相关级别.

Package level logging is the standard logging of log4j. With log4j configuration, you'd specify the package and the associated level.

简介示例中,有".com"的程序包级日志记录. foo".

In the intro example, there is package level logging for "com.foo".

# Print only messages of level WARN or above in the package com.foo.
log4j.logger.com.foo=WARN