日期:2014-05-18  浏览次数:20676 次

我的LOG4J怎么不输出日志啊
我的配置文件logConfig.properties
XML code
log4j.rootLogger=INFO,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.RollingFileAppender
log4j.appender.logfile.File=${myApp.root}/WEB-INF/logs/ideashopx.log
log4j.appender.logfile.MaxFileSize=1024KB
# Keep three backup files.
log4j.appender.logfile.MaxBackupIndex=3
# Pattern to output: date priority [category] - message
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n


web.xml的内容如下:
XML code
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_88" version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>JEZZ Struts 2.0 Project</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    <!-- 防止乱码过滤 -->
    <filter>   
    <filter-name>encoding</filter-name>     
         <filter-class>EnterpriseSite.EncodingFilter</filter-class>     
          <init-param>   
                    <param-name>encoding</param-name>   
                    <param-value>UTF-8</param-value>   
          </init-param>   
    </filter>                    
    <filter-mapping>     
                <filter-name>encoding</filter-name>     
                <url-pattern>/*</url-pattern>       
    </filter-mapping>
     
    <!-- 跟ONGL语言和request和response有关 -->
    <filter>
        <filter-name>struts-cleanup</filter-name>
        <filter-class>
            org.apache.struts2.dispatcher.ActionContextCleanUp
        </filter-class>
    </filter>    
    <filter-mapping>
        <filter-name>struts-cleanup</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- 过滤Struts2的action -->
    <filter>
        <filter-name>struts2</filter-name>        
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- 配置proxool连接池 -->
<servlet>
  <servlet-name>ServletConfigurator</servlet-name>
  <servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
  <init-param>
    <param-name>xmlFile</param-name>
    <param-value>WEB-INF/db.xml</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet>
    <servlet-name>Admin</servlet-name>
    <servlet-class>org.logicalcobwebs.proxool.admin.servlet.AdminServlet</servlet-class>
 </servlet>
 <servlet-mapping>
    <servlet-name>Admin</servlet-name>
    <url-pattern>/admin</url-pattern>
 </servlet-mapping>
    <!-- 配合SPRING配置log4j -->
    <context-param>
        <param-name>webAppRootKey</param-name>
        <param-value>myApp.root</param-value>
    </co