I am also using 'java.util.logging' but I have choosen following approach:
1) I have created 'logging.properties' configuration file with tuned options
2) My
ant building script places config in runme.jar at some place
3) At early stages of application running logging mechanism is instructed to load this config from jar provided user had not set his/her own configuration;
code snippet below:
try {
if (System.getProperty("java.util.logging.config.file") == null) {
// if there is no configuration set in environment
// jar class loader should take defaults from jar
InputStream is = getClass().getResourceAsStream(
"/path/inside/jar/file/logging.properties");
LogManager.getLogManager().readConfiguration(is);
}
} catch (IOException e) {
...
}
This is much simpler then programmatic manipulation
cheers,
andy