com::cosylab::cdb::jdal::logging::AcsLoggerHelper Class Reference

Collaboration diagram for com::cosylab::cdb::jdal::logging::AcsLoggerHelper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Logger getSharedLogger ()
void setDefaultLogLevels (AcsLogLevelDefinition localLevel, AcsLogLevelDefinition remoteLevel)
void setHibernateLogLevels (AcsLogLevelDefinition localLevel, AcsLogLevelDefinition remoteLevel)
void setHibernateSqlLogLevels (AcsLogLevelDefinition localLevel, AcsLogLevelDefinition remoteLevel)
synchronized void setLoggerName (String loggerName)
void shutdown ()

Static Public Member Functions

static synchronized AcsLoggerHelper getInstance ()

Static Public Attributes

static final String loggerNameDefault = "CDB-RDB"

Private Member Functions

 AcsLoggerHelper (String sharedLoggerName)

Private Attributes

Logger sharedLogger

Static Private Attributes

static String loggerName = null
static AcsLoggerHelper instance

Detailed Description

Creates a shared logger called "CDB-RDB" to be used by all hibernate DAL code. Its log level defaults to INFO for local and remote logging.

We should make the log levels configurable in the future.

Note 1: The hibernate framework will get its own ACS Loggers via a tapped slf4j framework. There are two loggers called "hibernate@CDB-RDB" and "hibernateSQL@CDB-RDB". Their log levels are configured here, to DEBUG for SQL logs, and WARNING for other logs, both for local and remote logs.

Note 2: Remote logging is disabled for the time being.

Author:
hsommer

Constructor & Destructor Documentation

com::cosylab::cdb::jdal::logging::AcsLoggerHelper::AcsLoggerHelper ( String  sharedLoggerName  )  [inline, private]

Member Function Documentation

static synchronized AcsLoggerHelper com::cosylab::cdb::jdal::logging::AcsLoggerHelper::getInstance (  )  [inline, static]
Logger com::cosylab::cdb::jdal::logging::AcsLoggerHelper::getSharedLogger (  )  [inline]

Returns a shared Logger, creating on demand. The logger name will be loggerNameDefault or the name given in setLoggerName(String) prior to the first call to this method.

References loggerName, and sharedLogger.

void com::cosylab::cdb::jdal::logging::AcsLoggerHelper::setDefaultLogLevels ( AcsLogLevelDefinition  localLevel,
AcsLogLevelDefinition  remoteLevel 
) [inline]
void com::cosylab::cdb::jdal::logging::AcsLoggerHelper::setHibernateLogLevels ( AcsLogLevelDefinition  localLevel,
AcsLogLevelDefinition  remoteLevel 
) [inline]
void com::cosylab::cdb::jdal::logging::AcsLoggerHelper::setHibernateSqlLogLevels ( AcsLogLevelDefinition  localLevel,
AcsLogLevelDefinition  remoteLevel 
) [inline]
synchronized void com::cosylab::cdb::jdal::logging::AcsLoggerHelper::setLoggerName ( String  loggerName  )  [inline]

Mainly thought for general hibernate layer test code, which does not like to use the application logger name "CDB-RDB".

Referenced by alma::acs::tmcdb::TestSnmpTables::setUp(), alma::acs::tmcdb::TestPojosPersistence::setUp(), and alma::acs::tmcdb::TestPojosCascading::setUp().

void com::cosylab::cdb::jdal::logging::AcsLoggerHelper::shutdown (  )  [inline]

JUnit tests need to call this if they don't want the logger to be reused between two tests. For some reason junit's classloader tricks fail here.

References instance, loggerName, and sharedLogger.


Member Data Documentation

Singleton instance

Referenced by getInstance(), and shutdown().

Logger name used by default. Can be changed

Referenced by getInstance().

The instance's logger, to be shared by the whole application using getSharedLogger();

Referenced by getSharedLogger(), and shutdown().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2