• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

null value in log4j level

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I have a problem with log4j with Struts. I have a variable in the log4j.properties that sets the log level, like this:

if (GlobalProperties.get("log_level").equals("ALL")){
logger.setLevel(Level.ALL);
}else if (GlobalProperties.get("log_level").equals("OFF")){
logger.setLevel(Level.OFF);
}
When the Action gets running it works fine. The problem is when I call a method in a different class, the logger level retrieves a null value. Neither the logger.getLevel() nor the logger.getEffectiveLogger() nor the getRoot(). What am I doing wrong? Thanks very much in advance!
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I may have been a bit premature in sending this here, but I suspect this is better served in the Struts forum, I'm sure the resident bartender(s) will throw it back if I'm wrong
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic