With "Introduce Log4J2LoggerFactory" pull-request merged there are a number
of improvements to GeoTools Logging class, and supporting infrastructure:


   - GEOT-7104 Clarify GeoTools.init() workflow and logging setup and
   configuration
   Please see new documentation on How to use Logging
   
<https://docs.geotools.org/latest/userguide/library/metadata/logging/use.html>
and
   LoggerFactory
   
<https://docs.geotools.org/latest/userguide/library/metadata/logging/factory.html>
   .
   - GEOT-7086 Introduce Log4J2LoggerFactory
   Please see Log4J 2 Interoperability
   
<https://docs.geotools.org/latest/userguide/library/metadata/logging/log4j.html>
page,
   uses metadata/src/it/log4j integration test examples
   - GEOT-7099 Introduces LogbackAdapterFactory
   Please see Logback Integration
   
<https://docs.geotools.org/latest/userguide/library/metadata/logging/logback.html>
   page, which uses metadata/src/it/logback integration test examples
   - GEOT-4248 Support logging to SLF4J - see above
   Logback can be used for any SLF4J integration, you just miss out on
   ability to use Logger.setLevel(Level). Supporting that method is optional
   in the java logging api anyways. Not a surprise really as if you are using
   SLF4J with a different (non Logback) backend it assumes you are responsible
   for configuring the backend logging system.
   - GEOT-7100 Tests Log4JLoggerFactory against reload4J dependencies
   Yes Log4JLoggerFactory is still with us, switched over to testing
   against Reload4J dependencies (so we do not have to maintain our own "safe"
   fork of Log4J 1.2 API).
   - GEOT-5625 introducing Log4JLoggerFactory levels for CONFIG and FINEST


Implementation notes:


   - One functional change: GeoTools.init() just accepts commons-logging as
   a first choice if the api is available. In a production environment chances
   are you do have commons-logging available and bridged to your preferred
   logging framework. And since commons-logging is painfully simple you would
   miss out non a lot of control (as there are fewer and stranger logging
   levels provided by commons-logging). See documentation
   
<https://docs.geotools.org/latest/userguide/library/metadata/logging/factory.html>
   and GeoTools.init()
   
<https://docs.geotools.org/latest/javadocs/org/geotools/util/factory/GeoTools.html#init-->
javadocs
   for details.
   - metadata/src/it tests are different, it sets up a local maven repo
   that treats the current build as a mirror repository. The result is we can
   test each LoggerFactory (and GeoTools.init()) behaviour in isolation which
   is exactly what we wanted. The resulting output is verified with a bean
   shell script....
   - Part of setting up integration testing, was making sure config and
   finest show up in the output for each (java util logging, commons-logging,
   log4j 1.2, log4j 2, logback). Each was slightly different, from defining
   new levels, to using "markers".
   - For completeness commons-logging has an integration test also.


Enjoy!
--
Jody Garnett
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to