001 : log4j 报错

来源:互联网 发布:.engineer域名 编辑:程序博客网 时间:2024/04/29 11:21

    导入了commons-logging.jar和log4j-1.2.16.jar两个jar包之后,就想试试log4j的强大功能了。没想到一运行就报了错

 

log4j:WARN No appenders could be found for logger (Log4jTest).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See
http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

 

稍微一看,才发现想要运行log4j的话,先要写一个log4j.properties的配置文档。不然就会报上面的错误。

附简单的代码:

原创粉丝点击