Search code examples
grailsloggingsuppress-warnings

Suppressing Grails Plugin WARN messages for Deprecated Behavior


We use quite a few Grails plugins for our application and apparently some of them are still using the deprecated ApplicationHolder.getApplication(). I can't seem to determine which ones are specifically and upgrading willy nilly is not an option.

When our log level is info or lower we get hundreds of these when grails starts up:

WARN util.GrailsUtil - [DEPRECATED] Method ApplicationHolder.getApplication() is deprecated and will be removed in a future version of Grails.

Is there any way at all to suppress these?

Update:

Based on the answer from baiyubin, I was able to at least fold them in the console in IDEA. However, that doesn't prevent 2095 lines from being added to my log file.


Solution

  • Since Grails 2.0 you can add a new VM parameter at startup:

    -Dgrails.log.deprecated=false
    

    Source: http://jira.grails.org/browse/GRAILS-8024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel