Overview | Package | Class | Tree | Deprecated | Index | Help
| The PDK Java API is part of the Portal Developer Kit on Portal Studio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.portal.log
Class LogManager

    java.lang.Object
      |
      +--oracle.portal.log.LogManager

public final class LogManager
extends java.lang.Object

LogManager is a configurable logging service that allows you to log messages at 7 different levels ranging from configuration to debug. To configure LogManager, you must provide an implementation of the `Logger` class. It is the Logger that performs the actual logging. The LogManager is initialized by calling the `init(Logger)` method and destroyed by calling the `destroyAll()` or `destroy(String)` method. It is important that calls to LogManager can be made AT ANY TIME regardless of the initialization state of the LogManager. For this reason, When a LogManager is created, it uses a NullLogger that "swallows" any messages logged to it. IMPORTANT: The semantics of LogManager do not allow any exceptions to be thrown. Any failures should be logged (if possible) and swallowed. A configuration issue in LogManager or a Logger should not interfere with the operation of any clients

Field Summary
`static int` | `LOG_LEVEL_CONFIG` calls to config() and log() result in messages being logged
`static int` | `LOG_LEVEL_DEBUG` all logging calls result in messages being logged
`static int` | `LOG_LEVEL_ERROR` calls to severe(), config() and log() result in messages being logged
`static int` | `LOG_LEVEL_EXCEPTION` calls to throwing(), warning(), severe(), config() and log() result in messages being logged
`static int` | `LOG_LEVEL_INFO` calls to Info(), perf(), throwing(), warning(), severe(), config() and log() result in messages being logged
`static int` | `LOG_LEVEL_PERF` calls to perf(), throwing(), warning(), severe(), config() and log() result in messages being logged
`static int` | `LOG_LEVEL_WARNING` calls to warning(), severe(), config() and log() result in messages being logged

Method Summary
`static void` | `config(java.lang.String message)` Logs the given message.
`static void` | `config(java.lang.String message, java.lang.Throwable throwable)` Logs the given `java.lang.Throwable` object, e.g.
`static void` | `debug(java.lang.String message)` Logs the given message.
`static void` | `destroy(java.lang.String context)` destroy a specified configured Logger
`static void` | `destroyAll()` destroy all configured loggers.
`static LogManager` | `getInstance()` returns a LogManager instance.
`static Logger` | `getLogger()` returns the logger associated with the current thread.
`static Logger` | `getLogger(java.lang.String context)` returns the logger associated with the specified context.
`static void` | `info(java.lang.String message)` Logs the given message.
`static java.lang.String` | `init(Logger logger)` Perform one-time initialization for a new LogManager context.
`static void` | `initCurrentThread(java.lang.String context, MessageContext msgContext)` Do per-thread initialization of the LogManager.
`static boolean` | `isConfigEnabled()` Returns true if Configuration level logging is enabled.
`static boolean` | `isDebugEnabled()` Returns true if Debug level logging is enabled.
`static boolean` | `isInfoEnabled()` Returns true if Information level logging is enabled.
`static boolean` | `isPerfEnabled()` Returns true if Performance level logging is enabled.
`static boolean` | `isSevereEnabled()` Returns true if Severe Error level logging is enabled.
`static boolean` | `isThrowingEnabled()` Returns true if Throwing (exception) level logging is enabled, otherwise false.
`static boolean` | `isWarningEnabled()` Returns true if Warning level logging is enabled.
`static void` | `log(java.lang.String message)` Logs the given message.
`static void` | `log(java.lang.String message, java.lang.Throwable throwable)` Logs the given `java.lang.Throwable` object, e.g.
`static void` | `perf(java.lang.String message)` Logs the given message.
`static void` | `resetCurrentThread()` Do per-thread clean-up to prevent accidental carry-over of context values when this thread is re-used (eg for another request).
`static void` | `severe(java.lang.String message)` Logs the given message.
`static void` | `severe(java.lang.String message, java.lang.Throwable throwable)` Logs the given `java.lang.Throwable` object, e.g.
`static void` | `throwing(java.lang.String message, java.lang.Throwable throwable)`
`static void` | `warning(java.lang.String message)` Logs the given message.
`static void` | `warning(java.lang.String message, java.lang.Throwable throwable)` Logs the given `java.lang.Throwable` object, e.g.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LOG_LEVEL_CONFIG

    public static int LOG_LEVEL_CONFIG

  calls to config() and log() result in messages being logged

### LOG_LEVEL_ERROR

    public static int LOG_LEVEL_ERROR

  calls to severe(), config() and log() result in messages being logged

### LOG_LEVEL_WARNING

    public static int LOG_LEVEL_WARNING

  calls to warning(), severe(), config() and log() result in messages being logged

### LOG_LEVEL_EXCEPTION

    public static int LOG_LEVEL_EXCEPTION

  calls to throwing(), warning(), severe(), config() and log() result in messages being logged

### LOG_LEVEL_PERF

    public static int LOG_LEVEL_PERF

  calls to perf(), throwing(), warning(), severe(), config() and log() result in messages being logged

### LOG_LEVEL_INFO

    public static int LOG_LEVEL_INFO

  calls to Info(), perf(), throwing(), warning(), severe(), config() and log() result in messages being logged

### LOG_LEVEL_DEBUG

    public static int LOG_LEVEL_DEBUG

  all logging calls result in messages being logged

Method Detail

### init

    public static java.lang.String init(Logger logger)

  Perform one-time initialization for a new LogManager context. This method lets you initialize a new logging context. The context identifier is assigned by the LogManager to prevent collisions with other logging contexts that may be in use within other applications
  Parameters:
    `logger` - the pre-initialized Logger that should be associated with the new context
  Returns:
    the context identifier

### initCurrentThread

    public static void initCurrentThread(java.lang.String context,
                                         MessageContext msgContext)

  Do per-thread initialization of the LogManager. Arguments needed to specify and configure a Logger should be specified
  Parameters:
    `context` - identifier of the logging context to be associated with the calling thread
    `msgContext` - MessageContext to be used by the Logger when logging messages from the calling thread

### resetCurrentThread

    public static void resetCurrentThread()

  Do per-thread clean-up to prevent accidental carry-over of context values when this thread is re-used (eg for another request).

### destroyAll

    public static void destroyAll()

  destroy all configured loggers.

### destroy

    public static void destroy(java.lang.String context)

  destroy a specified configured Logger
  Parameters:
    `context` - the context name of the Logger to be destroyed

### getInstance

    public static LogManager getInstance()

  returns a LogManager instance. This method is only useful for pinning the LogManager singleton because there are no publically accessible methods on the instance
  Returns:
    LogManager instance

### getLogger

    public static Logger getLogger()

  returns the logger associated with the current thread. if `initCurrentThread(String, MessageContext)` has not been called for the current thread, the NullLogger will be returned
  Returns:
    Logger associated with the current thread.

### getLogger

    public static Logger getLogger(java.lang.String context)

  returns the logger associated with the specified context. if `initCurrentThread(String, MessageContext)` has not been called for the current thread, the NullLogger will be returned
  Parameters:
    `context` - context identifier for the requested Logger
  Returns:
    Logger associated with the current thread.

### log

    public static void log(java.lang.String message)

  Logs the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - message to log.

### log

    public static void log(java.lang.String message,
                           java.lang.Throwable throwable)

  Logs the given `java.lang.Throwable` object, e.g. by logging the stack trace, along with the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - explanatory message.
    `throwable` - a `Throwable` exception.

### config

    public static void config(java.lang.String message)

  Logs the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - message to log.

### config

    public static void config(java.lang.String message,
                              java.lang.Throwable throwable)

  Logs the given `java.lang.Throwable` object, e.g. by logging the stack trace, along with the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - explanatory message.
    `throwable` - a `Throwable` exception.

### severe

    public static void severe(java.lang.String message)

  Logs the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - message to log.

### severe

    public static void severe(java.lang.String message,
                              java.lang.Throwable throwable)

  Logs the given `java.lang.Throwable` object, e.g. by logging the stack trace, along with the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - explanatory message.
    `throwable` - a `Throwable` exception.

### warning

    public static void warning(java.lang.String message)

  Logs the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - message to log.

### warning

    public static void warning(java.lang.String message,
                               java.lang.Throwable throwable)

  Logs the given `java.lang.Throwable` object, e.g. by logging the stack trace, along with the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - explanatory message.
    `throwable` - a `Throwable` exception.

### throwing

    public static void throwing(java.lang.String message,
                                java.lang.Throwable throwable)

  Parameters:
    `message` - explanatory message.
    `throwable` - a `Throwable` exception.

### info

    public static void info(java.lang.String message)

  Logs the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - message to log.

### perf

    public static void perf(java.lang.String message)

  Logs the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - message to log.

### debug

    public static void debug(java.lang.String message)

  Logs the given message. The object implementing `Logger` used by this `LogManager` is declared and configured in the LogManager XML Definition.
  Parameters:
    `message` - message to log.

### isConfigEnabled

    public static boolean isConfigEnabled()

  Returns true if Configuration level logging is enabled. Otherwise false.
  Returns:
    true if configuration level logging is enabled. Otherwise false.

### isSevereEnabled

    public static boolean isSevereEnabled()

  Returns true if Severe Error level logging is enabled. Otherwise false.
  Returns:
    true if severe error level logging is enabled. Otherwise false.

### isThrowingEnabled

    public static boolean isThrowingEnabled()

  Returns true if Throwing (exception) level logging is enabled, otherwise false.
  Returns:
    true if Throwing level logging is enabled. Otherwise false.

### isWarningEnabled

    public static boolean isWarningEnabled()

  Returns true if Warning level logging is enabled. Otherwise false.
  Returns:
    true if warning level logging is enabled. Otherwise false.

### isInfoEnabled

    public static boolean isInfoEnabled()

  Returns true if Information level logging is enabled. Otherwise false.
  Returns:
    true if Information level logging is enabled. Otherwise false.

### isPerfEnabled

    public static boolean isPerfEnabled()

  Returns true if Performance level logging is enabled. Otherwise false.
  Returns:
    true if performance level logging is enabled. Otherwise false.

### isDebugEnabled

    public static boolean isDebugEnabled()

  Returns true if Debug level logging is enabled. Otherwise false.
  Returns:
    true if debug level logging is enabled. Otherwise false.

Overview | Package | Class | Tree | Deprecated | Index | Help
| The PDK Java API is part of the Portal Developer Kit on Portal Studio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2002, Oracle Corporation. All Rights Reserved.