1

我正在使用 DWR3,但我不知道如何让日志记录工作。无论我做什么,在尝试调试编组问题时,我似乎都看不到任何 DWR3 输出。如何启用日志记录?

web.xml

<servlet>
    <servlet-name>dwr</servlet-name>
    <servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>
    <init-param>
        <param-name>jsonpEnabled</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>debug</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>accessLogLevel</param-name>
        <param-value>CALL</param-value>
    </init-param>
</servlet>

配置文件

debug 'org.directwebremoting.log.*'
info 'com.example.b'
debug 'com.example.a'

// Example of changing the log pattern for the default console
// appender:
//
appenders {
    console name: 'stdout', layout: pattern(conversionPattern: '%-5p: %c - %m%n')
}

这里发生了什么?

4

1 回答 1

1

不是一个确切的答案,但您可以使用此配置在前端更好地记录信息:

<dwr:configuration>
    ...
    <dwr:convert class="java.lang.Exception" type="exception"/>
    <dwr:convert class="java.lang.StackTraceElement" type="bean"/>
</dwr:configuration>
于 2011-05-27T17:00:25.383 回答