IsolatedLog4JLogger routes all commons-logging logging using Log4J to an ContextClassLoader
specific Hierarchy.
For web or application servers providing (and enforcing) commons-logging and
Log4J from a shared context (like JBoss), configuring Log4J loggers and appenders
from within a (web) application overrides and resets the global
Log4J LoggerRepository.
Capturing root logging for logging events from within the web application
for example isn't possible using a Log4J propery or xml configuration without
routing ALL root logging through the new (web application specific)
configuration.
It is possible using the Log4J API directly instead of configuration files,
but that requires hardcoded knowledge about how the logging is to be done.
Furthermore, if another application later on reconfigures the root logging again, the
current root logging configuration is closed, detached and rerouted to the new configuration.
The same applies of course to common named loggers like capturing springframework logging. |