Logging library priority in 2.4: skip Log4J and LogKit detection?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Logging library priority in 2.4: skip Log4J and LogKit detection?

Daniel Dekany
It's like this currently (that first fund will be used):

  SLF4J, Apache Commons Logging, Log4J, Avalon LogKit, and java.util.logging

I wonder that might be it would be like this:

  SLF4J, Apache Commons Logging (JCL), java.util.logging (JUL)

The reason of omitting Log4J and LogKit is that if you are using JUL
and then at some later point something pulls in Log4J or LogKit (as a
dependency), then that will suddenly take over logging in FreeMarker.
Now, the same argument can be made with JCL and SLF4J too (i.e.,
what's if something pulls them in at a later point), but that's less a
problem because these are quite common libraries so most certainly you
already have them from the beginning. Also the whole thing encourages
you to configure JCL and/or SLF4J, rather than using FreeMarker's
tricky (timing issues) and not-well-known
freemarker.Logger.selectLoggerLibrary method.

Of course, if systems with Log4J but no JCL neither SLF4J are that
common, that's a negative point for this new logic. (Same with Avalon
LogKit.) But I don't think they are, if we only count systems that are
using at least J2SE 1.5 (which is a requirement for FM 2.4). For those
few cases people should just drop in log4j-over-slf4j.jar. For Avalon,
something similar with JCL. (Or one can set these loggers explicitly
with freemarker.Logger.selectLoggerLibrary, although that's tricky.)

What do you think?

Best regards,
 Daniel Dekany

vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
FreeMarker-devel mailing list
[hidden email]