Oracle Fusion Middleware
Java API Reference for Oracle PDK Java

11g Release 1 (11.1.1)

E10691-01


oracle.portal.log
Class LogManager

java.lang.Object
  extended by oracle.portal.log.LogManager

public final class LogManager
extends java.lang.Object

In AS 11, all logging implementation should use the standard JUL(java.util. logging) and ODL. The level defined in this class is therefore converted to JUL Levels. Original comments of this class: 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
           
static int LOG_LEVEL_DEBUG
           
static int LOG_LEVEL_ERROR
           
static int LOG_LEVEL_EXCEPTION
           
static int LOG_LEVEL_INFO
           
static int LOG_LEVEL_PERF
           
static int LOG_LEVEL_PERF_DETAIL
           
static int LOG_LEVEL_WARNING
           
 
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. by logging the stack trace, along with the given message.
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 isPerfDetailEnabled()
          Returns true if perf_detail 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. by logging the stack trace, along with the given message.
static void perf(java.lang.String message)
          Logs the given message.
static void perfdetail(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. by logging the stack trace, along with the given message.
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. by logging the stack trace, along with the given message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_LEVEL_ERROR

public static int LOG_LEVEL_ERROR

LOG_LEVEL_WARNING

public static int LOG_LEVEL_WARNING

LOG_LEVEL_INFO

public static int LOG_LEVEL_INFO

LOG_LEVEL_CONFIG

public static int LOG_LEVEL_CONFIG

LOG_LEVEL_DEBUG

public static int LOG_LEVEL_DEBUG

LOG_LEVEL_EXCEPTION

public static int LOG_LEVEL_EXCEPTION

LOG_LEVEL_PERF

public static int LOG_LEVEL_PERF

LOG_LEVEL_PERF_DETAIL

public static int LOG_LEVEL_PERF_DETAIL
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.

perfdetail

public static void perfdetail(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.

isPerfDetailEnabled

public static boolean isPerfDetailEnabled()
Returns true if perf_detail level logging is enabled. Otherwise false.

Returns:
true if perf_detail 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.

Oracle Fusion Middleware
Java API Reference for Oracle PDK Java

11g Release 1 (11.1.1)

E10691-01


Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.