1

I've been using the javamelody monitoring plugin for a while in Grails with no problem, but lately I had to move my developments to another computer (I'm now using netbeans 7.1.2). After reinstalling the plugins, I run the app flawlessly in my development environment. But when I run the war to my production environment, the following warnings show up:

log4j:WARN No appenders could be found for logger (net.bull.javamelody). 
log4j:WARN Please initialize the log4j system properly. 
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

The appenders section in Config.groovy is:

appenders {
    console name:'stdout', layout:pattern(conversionPattern: '%d [%t] %-5p %c{2} %x - %m%n')
    appender new DailyRollingFileAppender (
        name: 'dailyAppender',
        datePattern: "'.'yyyy-MM-dd",
        fileName: "logs/${appName}.log",
        layout: pattern(conversionPattern:'%d [%t] %-5p %c{2} %x - %m%n')
    )
}

My questions are:

  • Why aren't these warnings present in the development environment's log ?
  • What are possible consecuences on the application ?

I'm running Grails 1.3.9, Melody 1.2, tomcat 7.0.23

Thanks

xain
  • 13,159
  • 17
  • 75
  • 119

1 Answers1

0
  • It might be different form environment to environment if you have setup a logging appender in the development section of your Grails Config.groovy file but not for your production section.
  • The consequences are that you will not have logging. You may have code in your application that says log.error("Critical Error!") but since this is not linked to any appender you will never see it anywhere.

Check out logging in the documentation.

skaz
  • 21,962
  • 20
  • 69
  • 98
  • Thanks for your reply. That's the weird thing, there's no specific setting regarding logging being differenciated in the Config.groovy file, so I expected the same behaviour in both environments. – xain Jul 14 '12 at 14:39
  • @xain Hmm...not sure. Also, when you say it is logging, is anything from `net.bull.javamelody` logging correctly? Try adding a line to your `Config.groovy` that adds logging for that package. I had some funky differences when I have done a build vs when I am debugging as well. – skaz Jul 14 '12 at 14:53
  • Ok, I'll give it a try later on (it's a production evironment after all). Thanks. – xain Jul 14 '12 at 15:58