码迷,mamicode.com
首页 > 移动开发 > 详细

【crawler】log4j:WARN No appenders could be found for logger (dao.hsqlmanager).

时间:2016-12-09 16:38:26      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:java   att   method   raw   war   can   rod   ref   console   

This Short introduction to log4j guide is a little bit old but still valid.

That guide will give you some information about how to use loggers and appenders.


Just to get you going you have two simple approaches you can take.

First one is to just add this line to your main method:

BasicConfigurator.configure();

Second approach is to add this standard log4j.properties (taken from the above mentioned guide) file to your classpath:

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

【crawler】log4j:WARN No appenders could be found for logger (dao.hsqlmanager).

标签:java   att   method   raw   war   can   rod   ref   console   

原文地址:http://www.cnblogs.com/kotete/p/6149736.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!