1

I cannot get weblogic to ouput the log to the console for jersey. I have this in my web.xml:

    <init-param>
        <param-name>com.sun.jersey.server.impl.container.ContainerRequestFilters</param-name>
        <param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
    </init-param>
    <init-param>
        <param-name>com.sun.jersey.server.impl.container.ContainerResponseFilters</param-name>
        <param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
    </init-param>

Which works great with jetty and tomcat. Log4j is also working good because I can get the log output for other modules like hibernate. I have this line in log4j.properties:

log4j.logger.com.sun.jersey=DEBUG

I am using Jersey 1.1.1.5.2 and log4j 1.2.16 on weblogic 10.3.6. Do I have to do something else to make it work?

4

1 に答える 1

4

com.sun.jersey.api.client.filter.LoggingFilter.java に記載されているように、jersey は標準の JDK ロガーを使用しています。

/**
 * Create a logging filter logging the request and response to
 * a default JDK logger, named as the fully qualified class name of this
 * class.
 */

出力を正しくログに記録するには、JDK ロギングを構成する必要があります。jul-to-slf4j + slf4j-log4j12 を使用すると、出力を log4j ログファイルに統合することができます。

于 2012-08-04T18:16:12.527 に答える