GeoTools uses Java logging (java.util.logging package), but GeoServer need the ability to log to different frameworks. We wish (if possible) to code against Java logging API since commons-logging is not the only candidate (SLF4J is an other one), Java logging is an attempt of standard API available on every JVM (1.4+) and its API is more elaborated than commons-logging one. The proposal is:
- Create a java.util.logging.Logger subclass, CommonLogger, that delegates everything to commons-logging, including methods like info(String) and isLoggable(Level). Some methods may not have direct match (e.g. getHandler), but they are of interest only for advanced users (and an indirect match is possible anyway with the CommonHandler already available in the GeoTools code base).
- Switch all Logger.getLogger(xxx) methods to a special GeoTools utility class (maybe the existing Logging class) that will return either the plain java logging logger, or the CommonLogger, depending on a configuration.
- We'll have some way to switch GeoTools logging one way or the other (and the same will have to work for GeoServer as well).
The level matching currently used is:
|Log4J Level||java.util.logging Level|