背景说明
不是web 应用,单独的java程序
报以下错误
log4j:WARN No appenders could be found for logger (xxxx).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
解决方案
调用 getLogger 之前。先初始化一下log系统
import org.apache.log4j.xml.DOMConfigurator;
BasicConfigurator.configure();