|
|
WS-Policy and moreFabian's Blog on WS-Policy and more |
|
Tuesday Jan 30, 2007
Configure java.util.logging at run-time
I recently wanted to change a few logging levels programmatically, i.e. without having to modify my system-wide properties (see e.g. Java Logging for Lazy Dogs) or starting the JVM with an extra option like: My first impulse was to google for a ready-made snippet of code. The results weren't exactly encouraging. I found a number of claims that you could not change the logging settings at run-time and numerous examples how to do one of the options mentioned above. So I decided to read the java.util.logging Javadocs instead. Is there anybody else that thinks the java.util.logging Javadocs are not particularly helpful, no matter what you are looking for? Anyway, this is the solution I finally came up with:
import java.io.IOException;
This code sets the name of a configuration file that will be read from your working directory and then reinitializes all loggers. Technorati: Java Posted at 02:27PM Jan 30, 2007 by Fabian Ritzmann in Sun | Comments:
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||