• log4j详解


    log4j.properties配置代码:

    ## loggers definition Level DEBUG INFO WARN ERROR FATAL
    
    log4j.rootLogger=DEBUG, stdout, log, errorlog  
    
      
    ###Console ###  
    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{ABSOLUTE} [ %t ] [ %p ]:%L - %m%n  
      
    ### Log ###    
    log4j.appender.log = org.apache.log4j.DailyRollingFileAppender  
    log4j.appender.log.File = D:/ERPLog/logs/log.log  
    log4j.appender.log.Append = true  
    log4j.appender.log.Threshold = DEBUG  
    log4j.appender.log.DatePattern='_'yyyy-MM-dd'.log'  
    log4j.appender.log.layout = org.apache.log4j.PatternLayout  
    log4j.appender.log.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} [ %t ] [%p]:%L %m%n  
      
    ### Error ###  
    log4j.appender.errorlog = org.apache.log4j.DailyRollingFileAppender 
    log4j.appender.errorlog.File = D:/ERPLog/logs/errorLog.log
    log4j.appender.errorlog.Append = true  
    log4j.appender.errorlog.Threshold = ERROR   
    log4j.appender.errorlog.DatePattern='_'yyyy-MM-dd'.log'  
    log4j.appender.errorlog.layout = org.apache.log4j.PatternLayout  
    log4j.appender.errorlog.layout.ConversionPattern =%d{yyyy-MM-dd HH:mm:ss} [ %t ] [%p]:%L %m%n 
    

    具体讲解参见 http://www.baike.com/wiki/log4j

  • 相关阅读:
    Christmas Jump(k_push)
    cloudyarn(k_push)
    Eye sketch
    Candy Treasure Box
    Active Ball
    Lotus words
    Super Fish
    [POJ2436] Disease Management
    [bzoj3376] Cube Stacking 方块游戏
    [POJ3009] Curling 2.0
  • 原文地址:https://www.cnblogs.com/suhfj-825/p/7941709.html
Copyright © 2020-2023  润新知