title

fire chief's random developer tidbits

Tuesday, October 4, 2011

java.util.logging is a joke

pointing the logging system to a properties file works with -Djava.util.logging.config.file=logging.properties
HOWEVER
if you have this contents for example:

handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

it will give the error:
"Can't set level for java.util.logging.ConsoleHandler"

This is simply because there is a SPACE after "level=FINE ".  Really!?  That's terrible.  Back to log4j or maybe logback.

1 comment:

  1. Thank you for this tip! I would have never guessed to look for a trailing space.

    ReplyDelete