Grails log4j configuration - ERROR配置log4j:logger时缺少方法 [英] Grails log4j configuration - ERROR Method missing when configuring log4j: logger

查看:199
本文介绍了Grails log4j configuration - ERROR配置log4j:logger时缺少方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我尝试向Grails log4j配置添加 logger {...}块时出现的原因,我收到以下错误:

  log4j:ERROR配置log4j时缺少方法:logger 

任何人都可以看到我的配置可能有什么问题?这是一个Grails 1.3.3应用程式(即将升级到2)。



TIA,



John

  log4j = {
error'org.codehaus.groovy.grails.web.servlet',// controllers
'org.codehaus.groovy.grails.web.pages',// GSP
'net.sf.ehcache.hibernate'
debug'org.hibernate'

appender {
console name:'stdout',layout:pattern(conversionPattern:'[%t]%-5p%c {2}%x - %m%n')
}

logger {
grails =error
}

root {
info'stdout'
}
}

我也得到以下错误,不知道是否可以相关?

  SLF4J:类路径包含多个SLF4J绑定。 
SLF4J:在[jar:file:/Users/pbwebguy/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.8.jar!/ org / slf4j / impl中找到绑定/staticLoggerBinder.class]
SLF4J:在[jar:file:/ data / dev / src / tdstm-trunk /./ plugins / jmesa-0.8 / lib / slf4j-log4j12-1.4.3.jar中找到绑定! /org/slf4j/impl/StaticLoggerBinder.class]
SLF4J:有关说明,请参阅http://www.slf4j.org/codes.html#multiple_bindings。


解决方案

完全在Grails 1.0和1.1之间。而不是

  logger {
grails =error
}



您只需要

  grails'

/ code>你有更高的。


For what ever reason when I attempt to add a logger {...} block to my Grails log4j configuration, I receive the following error:

log4j:ERROR Method missing when configuring log4j: logger

Can anyone see what might be wrong with my configuration? This is a Grails 1.3.3 application (soon to be upgraded to 2).

TIA,

John

log4j = {
   error 'org.codehaus.groovy.grails.web.servlet',  //  controllers
         'org.codehaus.groovy.grails.web.pages', //  GSP
         'net.sf.ehcache.hibernate'
   debug 'org.hibernate'

   appenders {
       console name:'stdout', layout:pattern(conversionPattern: '[%t] %-5p %c{2} %x - %m%n')
   }

   logger {
      grails="error"
   }

   root {
      info 'stdout'
   }
} 

I also get the following error just beforehand and don't know if it could be related?

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/pbwebguy/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/data/dev/src/tdstm-trunk/./plugins/jmesa-0.8/lib/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

解决方案

You're mixing up your syntaxes - logging configuration changed completely between Grails 1.0 and 1.1. Instead of

logger {
  grails="error"
} 

you just need

error 'grails'

along the same pattern as the debug 'org.hibernate' you have higher up.

这篇关于Grails log4j configuration - ERROR配置log4j:logger时缺少方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆