• log4j日志文件配置


    ### set log levels ###
    ### debug (打印代码中logger.debug(xx)的信息)> info(打印代码中logger.info(xx)的信息)
    log4j.rootLogger = info , C , D , E
    
    ### console ###
    log4j.appender.C = org.apache.log4j.ConsoleAppender
    log4j.appender.C.Target = System.out
    log4j.appender.C.layout = org.apache.log4j.PatternLayout
    log4j.appender.C.layout.ConversionPattern = [xmut-lgrg][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n
    
    ### log file ###
    log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.D.File =logs/xmut-lgrg.log(保存到logs下的文件夹)
    log4j.appender.D.Append = true
    log4j.appender.D.Threshold = INFO(info级别)
    log4j.appender.D.layout = org.apache.log4j.PatternLayout
    log4j.appender.D.layout.ConversionPattern = [xmut-lgrg][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n
    
    ### exception ###
    log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.E.File = ../logs/xmut-lgrg_error.log
    log4j.appender.E.Append = true
    log4j.appender.E.Threshold = ERROR
    log4j.appender.E.layout = org.apache.log4j.PatternLayout
    log4j.appender.E.layout.ConversionPattern = [xmut-lgrg][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n
    

      

  • 相关阅读:
    POJ 3292 Semi-prime H-numbers (素数筛法变形)
    POJ 1845 Sumdiv (整数拆分+等比快速求和)
    POJ 2635 The Embarrassed Cryptographer(大数求余)
    POJ 2115 C Looooops (扩展欧几里德 + 线性同余方程)
    poj3071
    poj2486
    poj1947
    POJ 1159
    POJ 1845
    poj3282
  • 原文地址:https://www.cnblogs.com/linjiaxin/p/7922785.html
Copyright © 2020-2023  润新知