log4j示例配置文件(属性文件) [英] log4j sample configuration file (properties file)
本文介绍了log4j示例配置文件(属性文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
开始使用log4j配置的最简单方法是什么?
What is the easiest way to get started with log4j configuration?
推荐答案
放一个名为的文件logpath根目录中的log4j.properties
:
log4j.rootLogger = ALL, Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.conversionPattern=%m%n
不需要其他任何东西。 Log4j将发现它并自行配置。
Nothing else is needed. Log4j will discover it and configure itself.
这篇关于log4j示例配置文件(属性文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文