Skip navigation links


com.essbase.eas.framework.defs.logger
Class Logger

java.lang.Object
  extended by com.essbase.eas.framework.defs.logger.Logger


public class Logger
extends java.lang.Object

This class defines the facilities and methods that a logging mechanism provides. The default level and location of logging can be set by the environment variables EAS_LOG_LEVEL and EAS_LOG_LOCATION. The EAS_LOG_LEVEL value should be an integer in the range 0-9999; if it isn't a valid integer, the default value WARNING will be used; if it is < 0, then 0 (NONE) will be used; if it is > 9999 (EVERYTHING), then logging will be set to EVERYTHING. The EAS_LOG_LOCATION value should be the name of a writable file. If it isn't then the logging location will be set to the default value of System.out.

Since:
6.5.2
Version:
7.0.0
Author:
Hank Cox

Field Summary
protected static java.lang.String API_ENTRY_TEXT
           
protected static java.lang.String API_EXIT_TEXT
           
static int CRITICAL
          CRITICAL indicates that critical level logging should take place.
static int ERROR
          ERROR indicates that error level logging should take place.
static int EVERYTHING
          EVERYTHING indicates that all logging should take place.
static int EXCEPTION
          EXCEPTION indicates that exception level logging should take place.
static int INFO
          INFO indicates that info level logging should take place.
static int NONE
          NONE indicates that no logging should take place.
protected static Logger theLogger
          The single logger being used by the application.
static int TRACE
          TRACE indicates that trace level logging should take place.
static int WARNING
          WARNING indicates that warning level logging should take place.
static int XML_TRACE
          XML_TRACE indicates that XML trace level logging should take place.

 

Constructor Summary
protected Logger()
          Constructs a Logger object with default values.

 

Method Summary
 java.lang.String getEASConsoleLogFile()
          Only for Console logger.
 int getEASLevel()
          Returns the current user logging level integer value (EAS level value)
static Logger getLogger()
          Returns the single logger.
static java.util.logging.Level getODLLevel(int easLevel)
           
static ODLLogger getODLLogger()
           
 void log(int level, java.lang.Object[] messages)
          Writes a series of messages to the logging stream, if the logger is set to the proper level.
 void log(int level, java.lang.String message)
          Writes a message to the logging stream, if the logger is set to the proper level.
 void log(int level, java.lang.String[] messages)
          Writes a series of messages to the logging stream, if the logger is set to the proper level.
 void log(int level, java.lang.String messageKey, java.lang.Object[] params)
           
 void log(int easLevel, java.lang.String msgKey, java.lang.Object[] msgParams, java.lang.Throwable t)
          Writes an exception message to the logging stream, if the logger is set to the proper level.
 void log(int level, java.lang.String resourceBundleName, java.lang.String messageKey, java.lang.Object[] params)
           
 void log(int easLevel, java.lang.String resourceBundleName, java.lang.String msgKey, java.lang.Object[] msgParams, java.lang.Object supplDetail)
          Writes an exception message to the logging stream, if the logger is set to the proper level.
 void log(int easLevel, java.lang.Throwable t)
          Writes an exception message to the logging stream, if the logger is set to the proper level.
 void log(java.lang.String message)
          Writes a message to the logging stream, if the logger is set to the proper level.
 void log(java.lang.Throwable t)
          Writes an exception message to the logging stream, if the logger is set to the proper level.
protected  void logAPI(java.lang.String tag, java.lang.String apiMessage, java.lang.Object[] messages)
          Writes a set of messages for an API function to the logging stream
 void logAPIEntry(java.lang.String functionName, java.util.List paramList)
          Log entry to an API function with a list of objects that were passed to the API call
 void logAPIEntry(java.lang.String functionName, java.lang.String paramString)
          Log entry into an API function
 void logAPIExit(java.lang.String functionName, int status)
          Log exit from an API function with no return values
 void logAPIExit(java.lang.String functionName, int status, java.util.List returnList)
          Log exit from an API function with a list of objects that were created from the API call
 void logAPIExit(java.lang.String functionName, int status, java.lang.String returnedResults)
          Log exit from an API function with a string representing the return values
 void logAPIExit(java.lang.String functionName, int status, java.lang.String[] returnedResults)
          Log exit from an API function with strings representing the return values
 void logEntry(java.lang.String className, java.lang.String methodName)
          Log entry into a method
 boolean logEntry(java.lang.String className, java.lang.String methodName, java.lang.Object[] params)
          Log entry into a method with parameters
 void logExit(java.lang.String className, java.lang.String methodName)
          Log exit from a method
 void logExit(java.lang.String className, java.lang.String methodName, java.lang.Object result)
          Log exit from a method with a result object

 

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

 

Field Detail

NONE

public static final int NONE
NONE indicates that no logging should take place.
See Also:
Constant Field Values

CRITICAL

public static final int CRITICAL
CRITICAL indicates that critical level logging should take place.
See Also:
Constant Field Values

ERROR

public static final int ERROR
ERROR indicates that error level logging should take place.
See Also:
Constant Field Values

WARNING

public static final int WARNING
WARNING indicates that warning level logging should take place.
See Also:
Constant Field Values

EXCEPTION

public static final int EXCEPTION
EXCEPTION indicates that exception level logging should take place.
See Also:
Constant Field Values

INFO

public static final int INFO
INFO indicates that info level logging should take place.
See Also:
Constant Field Values

TRACE

public static final int TRACE
TRACE indicates that trace level logging should take place.
See Also:
Constant Field Values

XML_TRACE

public static final int XML_TRACE
XML_TRACE indicates that XML trace level logging should take place.
See Also:
Constant Field Values

EVERYTHING

public static final int EVERYTHING
EVERYTHING indicates that all logging should take place.
See Also:
Constant Field Values

API_ENTRY_TEXT

protected static final java.lang.String API_ENTRY_TEXT
See Also:
Constant Field Values

API_EXIT_TEXT

protected static final java.lang.String API_EXIT_TEXT
See Also:
Constant Field Values

theLogger

protected static final Logger theLogger
The single logger being used by the application.

Constructor Detail

Logger

protected Logger()
Constructs a Logger object with default values. The logging level will be set to EXCEPTION.

Method Detail

getLogger

public static Logger getLogger()
Returns the single logger.
Returns:
the current application's logger

getODLLogger

public static ODLLogger getODLLogger()

getODLLevel

public static java.util.logging.Level getODLLevel(int easLevel)

getEASLevel

public int getEASLevel()
Returns the current user logging level integer value (EAS level value)
Returns:
the logging level as integer

getEASConsoleLogFile

public java.lang.String getEASConsoleLogFile()
Only for Console logger. This should be called only after updateFileNameWithUser.
Returns:

logAPI

protected void logAPI(java.lang.String tag,
                      java.lang.String apiMessage,
                      java.lang.Object[] messages)
Writes a set of messages for an API function to the logging stream
Parameters:
tag - the tag for the message
apiMessage - the api name that these log message are for
messages - the array of message to push to the log

log

public void log(int level,
                java.lang.String message)
Writes a message to the logging stream, if the logger is set to the proper level. If any exceptions are caught while trying to log the message, the message is pushed to System.out.
Parameters:
level - the level of the message we are logging
messages - an array of strings to log

log

public void log(java.lang.String message)
Writes a message to the logging stream, if the logger is set to the proper level. If any exceptions are caught while trying to log the message, the message is pushed to System.out.
Parameters:
messages - an array of strings to log

log

public void log(int level,
                java.lang.Object[] messages)
Writes a series of messages to the logging stream, if the logger is set to the proper level. If any exceptions are caught while trying to log the message, the message is pushed to System.out.
Parameters:
level - the level of the message we are logging
messages - an array of strings to log

log

public void log(int level,
                java.lang.String[] messages)
Writes a series of messages to the logging stream, if the logger is set to the proper level. If any exceptions are caught while trying to log the message, the message is pushed to System.out.
Parameters:
level - the level of the message we are logging
messages - an array of strings to log

log

public void log(int level,
                java.lang.String messageKey,
                java.lang.Object[] params)

log

public void log(int level,
                java.lang.String resourceBundleName,
                java.lang.String messageKey,
                java.lang.Object[] params)

logEntry

public void logEntry(java.lang.String className,
                     java.lang.String methodName)
Log entry into a method
Parameters:
className - the name of the class
methodName - the method of the class

logEntry

public boolean logEntry(java.lang.String className,
                        java.lang.String methodName,
                        java.lang.Object[] params)
Log entry into a method with parameters
Parameters:
className - the name of the class
methodName - the method of the class
params - parameters to the method
Returns:
true if the message was written, false otherwise

logExit

public void logExit(java.lang.String className,
                    java.lang.String methodName)
Log exit from a method
Parameters:
className - the name of the class
methodName - the method of the class

logExit

public void logExit(java.lang.String className,
                    java.lang.String methodName,
                    java.lang.Object result)
Log exit from a method with a result object
Parameters:
className - the name of the class
methodName - the method of the class
result - the object that is the result of the method

logAPIEntry

public void logAPIEntry(java.lang.String functionName,
                        java.lang.String paramString)
Log entry into an API function
Parameters:
functionName - the function we called
paramString - string representing the parameters

logAPIEntry

public void logAPIEntry(java.lang.String functionName,
                        java.util.List paramList)
Log entry to an API function with a list of objects that were passed to the API call
Parameters:
functionName - the function name
status - the exit status
returnList - list of strings or objects returned from the API function

logAPIExit

public void logAPIExit(java.lang.String functionName,
                       int status)
Log exit from an API function with no return values
Parameters:
functionName - the function called
status - the return status from the function

logAPIExit

public void logAPIExit(java.lang.String functionName,
                       int status,
                       java.lang.String returnedResults)
Log exit from an API function with a string representing the return values
Parameters:
functionName -
status -
returnedResults -

logAPIExit

public void logAPIExit(java.lang.String functionName,
                       int status,
                       java.lang.String[] returnedResults)
Log exit from an API function with strings representing the return values
Parameters:
functionName -
status -
returnedResults -

logAPIExit

public void logAPIExit(java.lang.String functionName,
                       int status,
                       java.util.List returnList)
Log exit from an API function with a list of objects that were created from the API call
Parameters:
functionName - the function name
status - the exit status
returnList - list of strings or objects returned from the API function

log

public void log(java.lang.Throwable t)
Writes an exception message to the logging stream, if the logger is set to the proper level. If any exceptions are caught while trying to log the exception, the exception is pushed to System.out.
Parameters:
t - the throwable ("exception") object to log.

log

public void log(int easLevel,
                java.lang.Throwable t)
Writes an exception message to the logging stream, if the logger is set to the proper level. If any exceptions are caught while trying to log the exception, the exception is pushed to System.out.
Parameters:
easLevel - logger level
t - Exception to be logged

log

public void log(int easLevel,
                java.lang.String msgKey,
                java.lang.Object[] msgParams,
                java.lang.Throwable t)
Writes an exception message to the logging stream, if the logger is set to the proper level. If any exceptions are caught while trying to log the exception, the exception is pushed to System.out.
Parameters:
easLevel - logger level
msgKey - Message key in logger.properties
msgParams - Parameters for the message
t - Exception to be logged

log

public void log(int easLevel,
                java.lang.String resourceBundleName,
                java.lang.String msgKey,
                java.lang.Object[] msgParams,
                java.lang.Object supplDetail)
Writes an exception message to the logging stream, if the logger is set to the proper level. If any exceptions are caught while trying to log the exception, the exception is pushed to System.out.
Parameters:
easLevel - logger level
resourceBundleName - Resource bundle name where msgId is available.
msgKey - Message key in logger.properties
msgParams - Parameters for the message
supplDetails - Additional detail about the message. If the object is a throwable, the the stack trace will be written to the message, otherwise, the toString() method will be use to convert the object to a String value.

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.