Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.logging
Class LogManager

    java.lang.Object
      com.bea.logging.LogManager

public class LogManager
extends Object

A factory for `ILogger` instances. This class hides the actual logging implemenation used by the framework.

Author:
  Copyright (c) 1998-2001 by BEA Systems, Inc. All Rights Reserved.

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

### LogManager

    public LogManager()

Method Detail

### configure

    public static final LogContext configure(String strLogConfigFile,
                                             String strRootLogContext,
                                             String strMessageBundleBase,
                                             Locale locale,
                                             ClassLoader classLoader)
                                      throws Exception

  Configures the underlying logging system with the parameters specified. Each application will have its own config file identified by `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.

  Parameters:
    `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 application
    `locale` - - identifies the desired locale for displaying log messages
    `classLoader` - - the ClassLoader to use to initialize log resources, such as ResourceBundles, log configuration file, etc.
  Throws:
    `Exception` - if an error occurs while attempting to initialize the logging framework.

### getLogger

    public static final ILogger getLogger(LogContext context)
                                   throws IllegalStateException,
                                          IllegalArgumentException

  Parameters:
    `context` - is a LogContext object
  Returns:
    an ILogger
  Throws:
    `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 null

### getResourceBundle

    public static final ResourceBundle getResourceBundle(LogContext context)

  Returns:
    the ResourceBundle for a given context

### getLogContext

    public static final LogContext getLogContext(Thread t)
                                          throws IllegalStateException,
                                                 IllegalArgumentException

  Retrieves a log context for a thread.

  Throws:
    `IllegalStateException` - if a log context has not been mapped for the thread passed in.
    `IllegalArgumentException`

### mapLogContextToThread

    public static final void mapLogContextToThread(Thread t,
                                                   LogContext logContext)

  Associates a log context with a thread. Allows a higher order component to set the log context for lower level components. Lower level components can create subcontexts from the return value. If a lower level component is not interested in creating a subcontext, it should just call the getLogger method with no arguments.

### getLogger

    public static final ILogger getLogger()
                                   throws IllegalStateException

  A convenience method to retrieve a logger for the current running thread.

  Returns:
    the current logger for the current thread
  Throws:
    `IllegalStateException` - if a log context has not been mapped for the current thread of execution.

### report

    public static final String report()

  Generates a debugging report on the current state of the LogManager

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD