• SSI框架中配置log4j


    事实上主要是log4j配置,跟SSI关系不大。

    web.xml中加入

    <context-param>
          <param-name>log4jConfigLocation</param-name>
          <param-value>/WEB-INF/localconf/log4j.properties</param-value>
       </context-param>
       <context-param>
          <param-name>log4jRefreshInterval</param-name>
          <param-value>6000</param-value>
       </context-param>
       
        <listener>
          <listener-class>
            org.springframework.web.util.Log4jConfigListener
          </listener-class>
    加入log4j.properties文件

    #log4j.rootLogger = [ level ] , appenderName, appenderName, ...
    log4j.rootLogger = DEBUG, console, R
    #level=INFO,all can be output
    #console is set to be a ConsoleAppender
    log4j.appender.console = org.apache.log4j.ConsoleAppender
    #console have four patterns
    #org.apache.log4j.HTMLLayout
    #org.apache.log4j.PatternLayout
    #org.apache.log4j.SimpleLayout
    #org.apache.log4j.TTCCLayout
    log4j.appender.console.layout = org.apache.log4j.PatternLayout
    #define the output type
    log4j.appender.console.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%n
    #file is set to output to a extra file
    log4j.appender.R = org.apache.log4j.RollingFileAppender
    #the absolute route of the log4j file
    log4j.appender.R.File = /log.txt
    #the size
    log4j.appender.R.MaxFileSize = 500KB
    #back up a file
    log4j.appender.R.MaxBackupIndex = 1
    log4j.appender.R.layout = org.apache.log4j.PatternLayout
    log4j.appender.R.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] - %m%n
    
    
    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.logger.java.sql.ResultSet=DEBUG 


  • 相关阅读:
    hdu 2680 最短路径(dijkstra算法+多源最短路径单源化求最小值)
    kmp算法
    STP根交换机,指定端口,根端口,阻塞端口
    python,django安装
    交换机access与trunk口
    树状数组
    hdoj 2191(多重背包)
    hdoj 2601(判断N=i*j+i+j)
    二维背包经典问题
    hdoj 2602(背包)
  • 原文地址:https://www.cnblogs.com/zfyouxi/p/3805357.html
Copyright © 2020-2023  润新知