|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.logging.LogManager
A factory for ILogger
instances. This class hides the
actual logging implemenation used by the framework.
Constructor Summary | |
LogManager()
|
Method Summary | |
static LogContext |
configure(String strLogConfigFile,
String strRootLogContext,
String strMessageBundleBase,
Locale locale,
ClassLoader classLoader)
Configures the underlying logging system with the parameters specified. |
static LogContext |
getLogContext(Thread t)
Retrieves a log context for a thread. |
static ILogger |
getLogger()
A convenience method to retrieve a logger for the current running thread. |
static ILogger |
getLogger(LogContext context)
|
static ResourceBundle |
getResourceBundle(LogContext context)
|
static void |
mapLogContextToThread(Thread t,
LogContext logContext)
Associates a log context with a thread. |
static String |
report()
Generates a debugging report on the current state of the LogManager |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LogManager()
Method Detail |
public static final LogContext configure(String strLogConfigFile, String strRootLogContext, String strMessageBundleBase, Locale locale, ClassLoader classLoader) throws Exception
strLogConfigFile
. Developers need to call this method prior
to using any logging functions for proper logging behavior.
Developers should be aware that if more than one configuration file is used
i.e., you are running multiple apps, each with its own configuration file,
their configuration parameters will be sharing the same namespace.
It is STRONLY RECOMMENDED that you use a unique logical name as the root
category name for all categories in your application. This will prevent
one application's category names from conflicting with those of another
application.
strLogConfigFile
- - a file on the classpath available to the
supplied ClassLoader that contains LOG4J configuration information that
conforms to the LOG4J.dtd.strRootLogContext
- - the root log category for your application; this
is used as the "key" for determining if the system has been configured
correctly, i.e. it should be unique to your application.strMessageBundleBase
- - the base name for the message bundles
containing log messages for your applicationlocale
- - identifies the desired locale for displaying log messagesclassLoader
- - the ClassLoader to use to initialize log resources,
such as ResourceBundles, log configuration file, etc.
Exception
- if an error occurs while attempting to initialize the
logging framework.public static final ILogger getLogger(LogContext context) throws IllegalStateException, IllegalArgumentException
context
- is a LogContext object
IllegalStateException
- - if there is no hierarchy for the locale
of the log context or the locale for the log context is null
IllegalArgumentException
- - if the log context is nullpublic static final ResourceBundle getResourceBundle(LogContext context)
public static final LogContext getLogContext(Thread t) throws IllegalStateException, IllegalArgumentException
IllegalStateException
- if a log context has not been mapped for the
thread passed in.
IllegalArgumentException
public static final void mapLogContextToThread(Thread t, LogContext logContext)
public static final ILogger getLogger() throws IllegalStateException
IllegalStateException
- if a log context has not been mapped for the
current thread of execution.public static final String report()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |