• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

null value in log4j level

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
 
In the renaissance, how big were the dinosaurs? Did you have tiny ads?
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!