Log4j exception in grails
log.debug("Id:" + domain.id)
being domain.id a long value, I get the exception:
Exception Message: No signature of method: groovy.util.ConfigObject.debug() is applicable for argument types: (java.lang.String) values: [Id:9] Possible solutions: getAt(java.lang.String), dump(), get(java.lang.Object), get(java.lang.Object), get(java.lang.Object), merge(groovy.util.ConfigObject)
Is it required in gra开发者_StackOverflowils to include only strings parameters in debug's arguments?
Are you sure that log
is an instance of Log4J's Logger
class? The error message looks a lot like it's an instance of a completely different class (groovy.util.ConfigObject
) instead.
Besides, as you can see from the error message, the methid is being called with just a string. The concatenation of the values (into a single string) has already happened by the time the method is invoked.
I think this happens because you are using log in a scope where there is no log defined.
Actually i have the same problem since i am trying to log from the config.groovy script.
精彩评论