问答详情
源自:3-3 创建包结构及实体-SSH环境搭建

配置文件问题

log4j文件怎么配置啊

提问者:qq_枯_叶黄_0 2018-03-04 12:18

个回答

  • qq_絵空事_1
    2018-03-04 15:23:51

    右键新建File,命名为log4j.properties。

    复制:

    # Configure logging for testing: optionally with log file

    log4j.rootLogger=WARN, stdout

    # log4j.rootLogger=WARN, stdout, logfile


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

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

    log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n


    log4j.appender.logfile=org.apache.log4j.FileAppender

    log4j.appender.logfile.File=target/spring.log

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

    log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n