|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etools.logging.util.DefaultMsgLogger
Licensed Material - Property of IBM (C) Copyright IBM Corp. 2003, 2005 - All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. This class is a wrapper of an instance of MsgLogger, where each of the static methods are delegated to this instance. CHANGE HISTORY Date Programmer Defect Description -------- ----------------- ------ -------------------------------- 23/01/01 rduggan@ca.ibm.com initial creation 14/09/01 paules@ca.ibm.com f184021 Added isLoggingLevel(Level), isLogging(), write([object/exception/primitive/thread]), writeCurrentThread(), setLevel(Level), getLevel(), getXMLFormat(), setXMLFormat(boolean), removed printStackToString(Throwable), setActive(boolean) and related instance variable(s) 18/09/01 paules@ca.ibm.com 184264 Re-added deprecated methods printStackToString(Throwable) and setActive(boolean). 27/09/01 paules@ca.ibm.com 185401 Added write(Level,[object/exception/primitive/thread]) methods. 28/09/01 paules@ca.ibm.com 185404 Added isActive() and setActive() which turns 'on' (logging) or 'off' (idle) the logger. 16/01/02 paules@ca.ibm.com 193621 Added get/setXMLDepth() methods. 10/10/02 paules@ca.ibm.com 223820 Added waitUntilMonitored() API. 06/02/03 amehrega@ca.ibm.com 230886 APIs to force and turn on/off log file archiving.
Field Summary | |
---|---|
protected static MsgLoggerFactory |
_factory
|
Constructor Summary | |
---|---|
DefaultMsgLogger()
|
Method Summary | |
---|---|
static void |
archiveFile()
Archives the current file |
static void |
closeFile()
If the DefaultMsgLogger has an associated file handle to an output file for logging, the existing file handle is closed. |
static void |
delArchivedFiles()
Deletes archived files based on the archive expiry day' |
static boolean |
getArchiveOnOff()
Returns true if archving is on; otherwise false is returned |
static java.lang.String |
getFileName()
Returns the logging file name. |
static boolean |
getFormatXMLOutput()
|
static int |
getLevel()
Retrieves the level of this logger. |
static java.lang.String |
getName()
Retrieves the name of this logger. |
static boolean |
getRotationalLogging()
Returns 'true' if rotational logging is turned ON, otherwise false is returned |
static int |
getXMLDepth()
Retrieves the current depth or nesting level of XML serialized objects (-n = maximum depth, 0 = no nesting , n = 'n' nesting levels). |
static boolean |
getXMLFormat()
Determines whether this logger is using XML as it's output format. |
static boolean |
isActive()
Checks if the logger is actively logging or turned 'on'. |
static boolean |
isLogging()
Checks if the current logging level is set to log information. |
static boolean |
isLoggingLevel(int level)
Checks if the current logging level is at the parameter check level or higher (i.e. |
static boolean |
isMonitored()
Checks if the logger is being monitored. |
static java.lang.String |
printStackToString(java.lang.Throwable aThrowable)
Deprecated. This method is not the correct way to return an exception's stack trace as a String. Logging messages are now logged using the write([object/exception/primitive/thread]) method. |
static void |
setActive(boolean active)
This method sets the flag that turns the logger 'on' for active logging or 'off' for no logging. |
static void |
setArchiveExpiryDays(int _archiveExpiryDays)
Sets the archive expiry day |
static void |
setArchiveOnOff(boolean archiveOnOff)
Turns on/off archiving |
static void |
setFileName(java.lang.String logFile)
This method sets the file name where messages are to be logged. |
static void |
setFormatXMLOutput(boolean formatXMLOutput)
|
static void |
setLevel(int newLevel)
Set the level of logging to one of the 8 levels (i.e. |
static void |
setMaxSize(long size)
Sets the maximum size of the log file used for rotational logging. |
static void |
setXMLDepth(int newDepth)
Set the current depth or nesting level of XML serialized objects (-n = maximum depth, 0 = no nesting , n = 'n' nesting levels). |
static void |
setXMLDetailLevel(int xmlDetailLevel)
|
static void |
setXMLFormat(boolean flag)
Turns logging in XML format either on or off. |
static void |
turnRLOff()
Turns OFF rotational logging. |
static boolean |
waitUntilMonitored(long maxTime)
Suspends the current thread until the logging agent is monitored or the the parameter maximum time (milliseconds) has expired. |
static void |
write(boolean msg)
Log a boolean message. |
static void |
write(byte msg)
Log a bute message. |
static void |
write(char msg)
Log a char message. |
static void |
write(double msg)
Log a double message. |
static void |
write(float msg)
Log a float message. |
static void |
write(int msg)
Log an int message. |
static void |
write(int level,
boolean msg)
Log a boolean message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(int level,
byte msg)
Log a byte message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(int level,
char msg)
Log a char message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(int level,
double msg)
Log a double message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(int level,
float msg)
Log a float message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(int level,
int msg)
Log an int message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(int level,
long msg)
Log a long message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(int level,
java.lang.Object obj)
Log an Object message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(int level,
short msg)
Log a short message if the current logging level is at the parameter check level or higher (i.e. |
static void |
write(long msg)
Log a long message. |
static void |
write(java.lang.Object record)
Log an Object message. |
static void |
write(short msg)
Log a short message. |
static void |
writeCurrentThread()
Log the stack trace of the current thread. |
static void |
writeStackTrace()
Log the current stack trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static MsgLoggerFactory _factory
Constructor Detail |
public DefaultMsgLogger()
Method Detail |
public static void closeFile()
public static java.lang.String printStackToString(java.lang.Throwable aThrowable)
public static void setXMLDetailLevel(int xmlDetailLevel) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static boolean getFormatXMLOutput()
public static void setFormatXMLOutput(boolean formatXMLOutput)
public static boolean isActive()
public static boolean isMonitored()
public static boolean waitUntilMonitored(long maxTime)
maxTime
- the maximum amount of time (milliseconds) to suspend the current thread
public static void setActive(boolean active)
active
- boolean flag that turns the logger 'on' or 'off'public static java.lang.String getName()
public static void setLevel(int newLevel)
newLevel
- new level of logging (i.e. LEVEL.FINEST - Level.NONE)public static void setMaxSize(long size)
size
- - The maximum size of the log file in bytespublic static void turnRLOff()
public static boolean getRotationalLogging()
public static int getLevel()
public static void setXMLDepth(int newDepth)
newDepth
- new depth or nesting level of XML serialized objectspublic static int getXMLDepth()
public static void setFileName(java.lang.String logFile)
logFile
- new file namepublic static java.lang.String getFileName()
public static void setXMLFormat(boolean flag)
public static boolean getXMLFormat()
public static boolean isLogging()
public static boolean isLoggingLevel(int level)
public static void write(int level, boolean msg)
msg
- the message to be loggedpublic static void write(boolean msg)
msg
- the message to be loggedpublic static void write(int level, char msg)
msg
- the message to be loggedpublic static void write(char msg)
msg
- the message to be loggedpublic static void write(int level, byte msg)
msg
- the message to be loggedpublic static void write(byte msg)
msg
- the message to be loggedpublic static void write(int level, short msg)
msg
- the message to be loggedpublic static void write(short msg)
msg
- the message to be loggedpublic static void write(int level, int msg)
msg
- the message to be loggedpublic static void write(int msg)
msg
- the message to be loggedpublic static void write(int level, long msg)
msg
- the message to be loggedpublic static void write(long msg)
msg
- the message to be loggedpublic static void write(int level, float msg)
msg
- the message to be loggedpublic static void write(float msg)
msg
- the message to be loggedpublic static void write(int level, double msg)
msg
- the message to be loggedpublic static void write(double msg)
msg
- the message to be loggedpublic static void write(int level, java.lang.Object obj)
public static void write(java.lang.Object record)
public static void writeCurrentThread()
public static void writeStackTrace()
public static void setArchiveOnOff(boolean archiveOnOff)
archiveOnOff
- is a flag that turns 'on' or 'off' archivingpublic static boolean getArchiveOnOff()
public static void archiveFile()
public static void delArchivedFiles()
public static final void setArchiveExpiryDays(int _archiveExpiryDays)
_archiveExpiryDays
- is an integer used to set the expiry days for archived file
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |