• log4j


    #newhappy  log4j.properties start
    log4j.rootLogger=DEBUG,INFO,stdout,myLogFile,error
    #log4j.rootLogger=DEBUG,INFO,myLogFile
    
    #console appender
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.Target=System.out
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}[%p] [%C.%M:%L] %m%n  
    #log4j.appender.myConsole.threshold=FATAL
    #rolling file appender
    log4j.appender.myLogFile=org.apache.log4j.RollingFileAppender
    log4j.appender.myLogFile.File=logs/log.log
    log4j.appender.myLogFile.MaxFileSize=3kB
    log4j.appender.myLogFile.MaxBackupIndex=100000
    log4j.appender.myLogFile.DatePattern = '.'yyyy-MM-dd'.log' 
    log4j.appender.myLogFile.layout=org.apache.log4j.PatternLayout
    log4j.appender.myLogFile.layout.ConversionPattern=%d{mmm d,yyyy hh:mm:ss a} : %p [%t] %m%n
    log4j.appender.myLogFile.threshold=info
    log4j.additivity.myLogFile = false
    
    ### error.log###
    log4j.appender.error = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.error.File = logs/error.log 
    log4j.appender.error.Append = true
    log4j.appender.error.Threshold = ERROR 
    log4j.appender.error.DatePattern = '.'yyyy-MM-dd'.log' 
    log4j.appender.error.layout = org.apache.log4j.PatternLayout
    log4j.appender.error.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n
    
    log4j.logger.com.ibatis=debug
    
    log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=debug
    log4j.logger.com.ibatis.common.jdbc.ScriptRunner=debug
    log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=debug
    log4j.logger.java.sql.Connection=debug
    log4j.logger.java.sql.Statement=debug
    log4j.logger.java.sql.PreparedStatement=debug,stdout
    log4j.logger.java.sql.ResultSet=INFO
    log4j.logger.org.apache=INFO
  • 相关阅读:
    Spring Boot----处理异常
    Spring Boot----SpringBoot中SpringMVC配置原理
    git----常见问题
    源码分析----Mybatis
    spring----一些xml配置
    Spring MVC----spring MVC 异常处理
    java----小游戏
    java----垃圾回收机制
    java----常见jar包
    anconda安装
  • 原文地址:https://www.cnblogs.com/laowang12/p/8945249.html
Copyright © 2020-2023  润新知