Oracle Fusion Middleware extensions for XML based Datamodel Framework
11g Release 1 (11.1.1.5)

E22566-01

oracle.apps.fnd.applxdf.comp
Class XDFLogger

java.lang.Object
  extended by oracle.apps.fnd.applxdf.comp.XDFLogger
Direct Known Subclasses:
ObservableTextLogger

public class XDFLogger
extends java.lang.Object

Wrap class to Java Logger. Supports logging to console(System.err) or a file.


Constructor Summary
XDFLogger()
          Constructor.
 
Method Summary
protected static void addConsoleHandler(java.util.logging.Logger oLog, java.lang.String szFormat)
          Add a console handler to a given logger.
 void closeFileHandler()
          Colse all file handlers that added to the given logger.
 void flushMessages(boolean endOfLogging)
          method to flush messages
 java.util.ArrayList getAllMessagesList()
          Returns the list with all the log messages.
 int getDebugLevel()
          Get the debug level
static java.util.logging.Logger getLogger(java.lang.String szName, java.lang.String szFormat)
          Convient method to get the logger and initial the hanlder with name and log format.
static java.util.logging.Logger getLogger(java.lang.String szName, java.lang.String szFormat, java.lang.String szResourceBundle)
          Convient method to get the logger and initial the hanlder with name, log format, and resource bundle.
 java.lang.String getMessage(java.lang.String szLog, java.lang.Object[] args)
          Get message string.
protected  boolean isHandlerExist(java.util.logging.Logger sLog, java.lang.String szHandlerType)
          check to see if the given logger has a handler.
 void log(java.lang.String logLevel, java.lang.String logMsg)
          Add message to log.
 void log(java.lang.String logLevel, java.lang.String logMsg, java.lang.Object[] args)
          Add message to log.
 void log(java.lang.String logLevel, java.lang.String logMsg, java.lang.String passinTimestampStr)
          Add message to log.
protected  void removeConsoleHandler(java.util.logging.Logger sLog)
          Remove all console handlers that added to a given logger.
 void setCalledFromJdev(boolean theCalledFromJdev)
          Set the called from JDev flag
protected  void setConsoleFormat(java.util.logging.Logger sLog, java.lang.String szFormat)
          Set console handler format.
 void setDebugLevel(int theDebugLevel)
          Set the debug level.
 void setLogFile(java.lang.String logFile)
          Set the log file.
 void setLogFormat(java.lang.String logFormat)
          Set the log format.
 void setupHandler()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDFLogger

public XDFLogger()
Constructor.

Method Detail

setLogFormat

public void setLogFormat(java.lang.String logFormat)
Set the log format.

Parameters:
logFormat - log format

setLogFile

public void setLogFile(java.lang.String logFile)
Set the log file.

Parameters:
logFile - log file name

setDebugLevel

public void setDebugLevel(int theDebugLevel)
Set the debug level.

Parameters:
theDebugLevel - debug level

getDebugLevel

public int getDebugLevel()
Get the debug level

Returns:
the debug level

setCalledFromJdev

public void setCalledFromJdev(boolean theCalledFromJdev)
Set the called from JDev flag

Parameters:
theCalledFromJdev - called from JDev flag

log

public void log(java.lang.String logLevel,
                java.lang.String logMsg)
Add message to log. The message includes logging time, log level, log message body.

Parameters:
logLevel - The log level.
logMsg - The logging message.

log

public void log(java.lang.String logLevel,
                java.lang.String logMsg,
                java.lang.Object[] args)
Add message to log. The message includes logging time, log level, log message body.

Parameters:
logLevel - The log level.
logMsg - The logging message.
args - - log message parameter.

log

public void log(java.lang.String logLevel,
                java.lang.String logMsg,
                java.lang.String passinTimestampStr)
Add message to log. The message includes logging time, log level, log message body.

Parameters:
logLevel - The log level.
logMsg - The logging message.
passinTimestampStr - time stamp string

getAllMessagesList

public java.util.ArrayList getAllMessagesList()
Returns the list with all the log messages.

Returns:
The message array list.

flushMessages

public void flushMessages(boolean endOfLogging)
method to flush messages

Parameters:
endOfLogging - The flag to indicate whether this is the end of the logging.

getLogger

public static java.util.logging.Logger getLogger(java.lang.String szName,
                                                 java.lang.String szFormat)
Convient method to get the logger and initial the hanlder with name and log format.

Parameters:
szName - - name of logger.
szFormat - - format of the log.

getLogger

public static java.util.logging.Logger getLogger(java.lang.String szName,
                                                 java.lang.String szFormat,
                                                 java.lang.String szResourceBundle)
Convient method to get the logger and initial the hanlder with name, log format, and resource bundle.

Parameters:
szName - - name of logger.
szFormat - - format of the log.

addConsoleHandler

protected static void addConsoleHandler(java.util.logging.Logger oLog,
                                        java.lang.String szFormat)
Add a console handler to a given logger.

Parameters:
oLog - - a logger.
szFormat - - format of the log.

setConsoleFormat

protected void setConsoleFormat(java.util.logging.Logger sLog,
                                java.lang.String szFormat)
Set console handler format.

Parameters:
sLog - - a logger.

closeFileHandler

public void closeFileHandler()
Colse all file handlers that added to the given logger.


removeConsoleHandler

protected void removeConsoleHandler(java.util.logging.Logger sLog)
Remove all console handlers that added to a given logger.

Parameters:
sLog - - a logger.

isHandlerExist

protected boolean isHandlerExist(java.util.logging.Logger sLog,
                                 java.lang.String szHandlerType)
check to see if the given logger has a handler.

Parameters:
sLog - - a logger.
szHandlerType - - handler type.

getMessage

public java.lang.String getMessage(java.lang.String szLog,
                                   java.lang.Object[] args)
Get message string. If the passed msg is a message id, then will get the message from resource bundle.

Parameters:
szLog - - passed log message
args - - log message argument

setupHandler

public void setupHandler()

Oracle Fusion Middleware extensions for XML based Datamodel Framework
11g Release 1 (11.1.1.5)

E22566-01

Copyright © 2011 Oracle. All Rights Reserved.