Public Member Functions | Static Public Attributes

org.slf4j.impl.ACSLoggerFactory Class Reference

Inherits org::slf4j::ILoggerFactory.

List of all members.

Public Member Functions

synchronized Logger getLogger (String name)
synchronized void clearDelegateLoggers ()

Static Public Attributes

static final String HIBERNATE_LOGGER_NAME_PREFIX = "hibernate"
static final String HIBERNATE_SQL_LOGGER_NAME_PREFIX = "hibernateSQL"

Detailed Description

ACSLoggerFactory is an implementation of slf4j's ILoggerFactory based on AcsLoggers, allowing for hibernate logs to be streamed into the ACS logging system. This class gets connected to the slf4j framework via StaticLoggerBinder, which is pulled in by slf4j from the classpath. Therefore no other slf4j bindings to different logging frameworks are allowed on the classpath.

A side effect of this is that any other software package which in the future might also rely on slf4j logging will get a logger called "hibernate" or "hibernate@<process name>".

Simplification of the large number of hibernate loggers: The hibernate framework tries to use separate loggers with names being those of its java classes, e.g. "org.hibernate.cfg.Ejb3Column". ACS maps all of these logger requests to only 2 different loggers, which can be configured separately:

A similar name reduction is used for JacORB loggers, see alma.acs.logging.adapters.JacORBLoggerFactory#getNamedLogger(String).

Author:
msekoranja, hsommer

Member Function Documentation

synchronized void org.slf4j.impl.ACSLoggerFactory.clearDelegateLoggers (  ) 

Should only be called by tests. For example, JUnit test cases that use different logger names for every test need to call this in order for hibernate loggers to be re-created.

synchronized Logger org.slf4j.impl.ACSLoggerFactory.getLogger ( String  name  ) 

Member Data Documentation

Mapped to all hibernate loggers except those from HIBERNATE_SQL_LOGGER_NAME_PREFIX.

Referenced by org.slf4j.impl.ACSLoggerFactory.getLogger().

Mapped to hibernate loggers "org.hibernate.SQL" (for SQL statements) and "org.hibernate.type.xyz" (for SQL binding parameters).

Hibernate announces that version 4 will rename the SQL logger to "org.hibernate.jdbc.util.SQLStatementLogger" which is why we already map that currently not existing logger name to the same sql logger.

Referenced by org.slf4j.impl.ACSLoggerFactory.getLogger().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties