Gregg
Gregg

Reputation: 35864

Grails 2.0: Disable All Logging for Resources

Is it possible and how can I disable all logging for Resources? For example:

Error 2012-04-26 19:48:00,929 [pool-5-thread-1] ERROR resource.ResourceMeta - While processing /bundle-bundle_core_head.css, /css/main.css, /lib/bootstrap/css/bootstrap.min.css, a resource was required but not found: /images/go-dn-on.gif

I'm glad I have it so I can fix it, but I really want to stop it from showing up in log files, although I still need to show ERROR level from everything else.

Upvotes: 0

Views: 1616

Answers (2)

demon101
demon101

Reputation: 564

In Config.groovy log4j section add line

off 'org.grails.plugin.resource.ResourceMeta'

Try the following for disable all logs

off 'grails.app.services.org.grails.plugin.resource',
'grails.app.taglib.org.grails.plugin.resource',
'grails.app.resourceMappers.org.grails.plugin.resource' 

Upvotes: 1

kenota
kenota

Reputation: 5662

In appenders section of Config.groovy add following appender:

    'null' name: 'empty'

Then, in log4j section redirect error messages from resource to this appender:

error empty: ['grails.app.services.org.grails.plugin.resource',
    'grails.app.taglib.org.grails.plugin.resource',      
    'grails.app.resourceMappers.org.grails.plugin.resource']

This should do the trick.

Upvotes: 0

Related Questions