1.log4j代码中修改输出级别: 如:
protected final Logger logger = LoggerFactory.getLogger(Test.class);
将其转成实现类,修改输出级别即可 System.out.println(logger.isDebugEnabled()?"debug is true":"debug is false"); ch.qos.logback.classic.Logger cLogger= (ch.qos.logback.classic.Logger)logger; cLogger.setLevel(Level.INFO); System.out.println(logger.isDebugEnabled()?"debug is true":"debug is false"); 2.log4j配置相关资料: 基本:http://blog.csdn.net/azheng270/article/details/2173430/ 分文件输出: 这个也似乎没什么问题[尚未验证]:https://www.cnblogs.com/yidaxia/p/5820036.html 经验证,最终还是这个说的OK:http://blog.csdn.net/hu_shengyang/article/details/6754031 3.配置Log输出的相对路径: http://blog.csdn.net/whoopee/article/details/851416