在类路径下创建一个log4j.properties,将下面代码复制进去就好
log4j.rootLogger=DEBUG, Console log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.layout=org.apache.log4j.PatternLayout log4j.appender.Console.layout.ConversionPattern=%-5p %m%n log4j.logger.org.apache=INFO