grails - DWR是否启用了grails登录?

标签 grails groovy log4j dwr

我正在使用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>

Config.groovy
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')
}

这里发生了什么?

最佳答案

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

<dwr:configuration>
    ...
    <dwr:convert class="java.lang.Exception" type="exception"/>
    <dwr:convert class="java.lang.StackTraceElement" type="bean"/>
</dwr:configuration>

关于grails - DWR是否启用了grails登录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6145142/

相关文章:

java - 在单元测试中模拟 Controller 标准...grails

Grails:如何在 GORM 中设置域类属性时执行操作

java - Ant build.xml 中的 Groovy(带有 Java 类)

java - 如何将java应用程序日志添加到系统日志

java - 如何使用JMS Appender?

hibernate - Grails 命名 id 列错误

eclipse - 为什么 Eclipse STS 上没有 Grails 和 Groovy 的代码洞察?

java - 如何使用 Java SAAJ 在 Soap Request XML 中添加子元素

java - Log4J 2配置: How to split log files by size and by day at the same time?

grails - Grails 2.4.5和404变成500