问答详情
源自:3-2 引入相应配置文件-SSH环境搭建

求老师的log4j.properties文件

说好的老师的资料呢?

提问者:我叫土小豆 2016-10-09 11:44

个回答

  • qq_陈志_0
    2016-10-09 15:27:23
    已采纳

    log4j.rootLogger = debug, console, E
    #level=INFO,all can be output
    #console is set to be a ConsoleAppender
    log4j.appender.console = org.apache.log4j.ConsoleAppender
    log4j.appender.console.layout = org.apache.log4j.PatternLayout
    log4j.appender.console.layout.ConversionPattern = [%p] %d{yyyy-MM-dd HH:mm:ss} - %m%n


    #file is set to output to a extra file
    log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.E.layout = org.apache.log4j.PatternLayout
    log4j.appender.E.Threshold=error
    log4j.appender.E.Encoding=UTF-8
    log4j.appender.E.layout.ConversionPattern=[%p] %d{yyyy-MM-dd HH:mm:ss} - %m%n
    log4j.appender.E.DatePattern='.'yyyy-MM-dd
    log4j.appender.E.File = ${catalina.base}/logs/dd/error.log

  • 秦家小小神
    2017-03-13 22:46:16

    # DEBUG < INFO < WARN < ERROR < FATAL

    # Global logging configuration

    log4j.rootLogger=info, stdout,file

    # My logging configuration...

    #log4j.logger.com.tocersoft.school=DEBUG

    #log4j.logger.net.sf.hibernate.cache=debug

    ## Console output...

    log4j.appender.stdout=org.apache.log4j.ConsoleAppender

    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

    log4j.appender.stdout.layout.ConversionPattern=%5p %d %C: %m%n

     

    log4j.appender.file=org.apache.log4j.FileAppender

    log4j.appender.file.File=../logs/iask.log

    log4j.appender.file.layout=org.apache.log4j.PatternLayout

    log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}  %l  %m%n

     

    log4j.logger.org.apache.activemq.spring=WARN

    #see cache info

    log4j.logger.org.hibernate.cache=info

    为什么我百度到的不一样?

  • 慕粉4062358
    2016-11-10 16:53:25

    为什么和另外一个人传的log4j文件内容不一样啊

  • 我叫土小豆
    2016-10-11 16:26:52

    谢谢了