java日志Log4j

  Java中提供的日志类:org.apache.log4j.Logger

  添加log4j  jar包

  配置log4j属性文件:log4j.properties

    log4j.rootLogger = debug,D

    log4j.appender.D = org.apache.log4j.DailyRollingFileAppender

    log4j.appender.D.File = log/log.log
    log4j.appender.D.Append = true
    log4j.appender.D.Threshold = DEBUG
    log4j.appender.D.layout = org.apache.log4j.PatternLayout
    log4j.appender.D.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} [%t:%r]-[%p] %m%n

  

  

  

posted @ 2015-11-16 22:37  丶大雄  阅读(154)  评论(0编辑  收藏  举报