SSM日志文件和SpringBoot logbak日志文件

日志文件,注意文件名是默认的,改的话,自己改配置

SSM

log4j.properties

#日志级别 ERROR,WARN,DEBUG,INFO,Console
log4j.rootLogger=DEBUG,INFO,Console,FILE

#控制台打印
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d %-5p [%c{5}] - %m%n

#打印MyBatis信息
log4j.logger.com.ibatis=DEBUG
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
#输出日志到文件

log4j.appender.FILE=org.apache.log4j.RollingFileAppender  
log4j.appender.FILE.Append=true  
log4j.appender.FILE.File=../logs/pptShow.log  
log4j.appender.FILE.Threshold=INFO  
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout  
log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} [%5p] - %c -%F(%L) -%m%n  
log4j.appender.FILE.MaxFileSize=15MB

SpringBoot

logback-spring.xml 



    
    sp-ppt_show
    
    
    

    
    
        
        ${LOG_PATH}/${APPDIR}/log_error.log
        
        
            
            ${LOG_PATH}/${APPDIR}/error/log-error-%d{yyyy-MM-dd}.%i.log
            
            
                50MB
            
        
        
        true
        
        
            [%p|%d{yyyy-MM-dd HH:mm:ss}] [%t|%C|%M|%L] - %m%n
            utf-8
        
        
        
            error
            ACCEPT
            DENY
        
    

    
    
        
        ${LOG_PATH}/${APPDIR}/log_warn.log
        
        
            
            ${LOG_PATH}/${APPDIR}/warn/log-warn-%d{yyyy-MM-dd}.%i.log
            
            
                50MB
            
        
        
        true
        
        
            [%p|%d{yyyy-MM-dd HH:mm:ss}] [%t|%C|%M|%L] - %m%n
            utf-8
        
        
        
            warn
            ACCEPT
            DENY
        
    

    
    
        
        ${LOG_PATH}/${APPDIR}/log_info.log
        
        
            
            ${LOG_PATH}/${APPDIR}/info/log-info-%d{yyyy-MM-dd}.%i.log
            
            
                50MB
            
        
        
        true
        
        
            [%p|%d{yyyy-MM-dd HH:mm:ss}] [%t|%C|%M|%L] - %m%n
            utf-8
        
        
        
            info
            ACCEPT
            DENY
        
    

    
        
        
            ===%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n
            utf-8
        
        
        
            debug
        
    

        
    

    
    
        
        
        
        

        
        
    

 

你可能感兴趣的:(Java,SpringBoot,ssm,日志配置,javaweb,log4j,logbak)