Olá Pessoal
Gostaria de saber se tem como trocar o level do Log4J em tempo de execução em um Application Server?? já ou falar em algumas maneiras, mas se tiver como gostaria ver um exemplo se possível!!!!
Olá Pessoal
Gostaria de saber se tem como trocar o level do Log4J em tempo de execução em um Application Server?? já ou falar em algumas maneiras, mas se tiver como gostaria ver um exemplo se possível!!!!
// get a logger instance named "com.foo"
Logger logger = Logger.getLogger("com.foo");
// Now set its level. Normally you do not need to set the
// level of a logger programmatically. This is usually done
// in configuration files.
logger.setLevel(Level.INFO);
Logger barlogger = Logger.getLogger("com.foo.Bar");
// This request is enabled, because WARN >= INFO.
logger.warn("Low fuel level.");
// This request is disabled, because DEBUG < INFO.
logger.debug("Starting search for nearest gas station.");
// The logger instance barlogger, named "com.foo.Bar",
// will inherit its level from the logger named
// "com.foo" Thus, the following request is enabled
// because INFO >= INFO.
barlogger.info("Located nearest gas station.");
// This request is disabled, because DEBUG < INFO.
barlogger.debug("Exiting gas station search");