log4j in grails : how to log into file?

前端 未结 3 1294
Happy的楠姐
Happy的楠姐 2021-02-09 10:45

I have this log4j configuration in my grails config.groovy

log4j = {
    error  \'org.codehaus.groovy.grails.web.servlet\',  //  controllers
                   \         


        
相关标签:
3条回答
  • 2021-02-09 10:51

    just got answer from the grails' mailing list:

    i just need to add

    debug "grails.app"

    bellow warn "org.mortbay.log"

    case closed ! :)

    0 讨论(0)
  • 2021-02-09 10:56

    please see Log4j: How to write to a specific appender?

    After all the solution is to put the additivity setting to the package configuration:

    info specialLog:'activityLog', additivity:false

    0 讨论(0)
  • 2021-02-09 11:08

    I have exact the same jetty/tomcat env's. Spent hours to figure it out. The trick is to define the file location (a relative path in my case) as a global variable inside Config.groovy, customized it in the environment blocks, and use the variable location inside log4j closure. Sample code is at: http://denistek.blogspot.com/2010/02/grails-environment-specific-logging-to.html

    0 讨论(0)
提交回复
热议问题