|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etools.logging.util.AbstractMessageLogger
Field Summary | |
---|---|
protected static AbstractMessageLoggerFactory |
_factory
|
static java.lang.String |
abstractMessageLoggerCopyright
Copyright statement. |
Constructor Summary | |
---|---|
AbstractMessageLogger()
AbstractMessageLogger constructor. |
Method Summary | |
---|---|
void |
archiveFile()
Archives the file being used |
protected void |
checkEnvironment()
Deprecated. This method is not the correct way to check the environment variable(s) to turn logging on and off. Logging is now based on a logging level (see Level.java) rather than a boolean environment variable. Setting the level (and any other preferences) from the environment variable(s) will be handled under the covers in future releases. The preferred way to do this is via the setLevel(Level) method. |
void |
closeFile()
If the current logger has an associated file handle to an output file for logging, the existing file handle is closed. |
void |
delArchivedFiles()
Deletes archived files based on '_archiveExpiryDays' |
void |
finalize()
Deregisters this Logging Agent instance from the Agent Controller. |
int |
getArchiveExpiryDays()
The number of days since an archived file was archived and its deletion. |
boolean |
getArchiveOnOff()
Returns archiveOnOff |
static AbstractMessageLoggerFactory |
getFactory()
Get the factory for this logger. |
java.lang.String |
getFileName()
Returns the logging file name. |
boolean |
getFormatXMLOutput()
Determines whether XML log message strings are formatted (i.e. |
boolean |
getIncludeTimeStamp()
Deprecated. As of May 25, 2004, time stamps are included in all generated Common Base Events. |
int |
getLevel()
Retrieves the level of this logger. |
AgentConfiguration |
getLoggingAgentDefaultConfiguration()
Return the default configuration for this logger's LoggingAgent. |
java.util.Hashtable |
getMsgLoggerConfig()
Retrieves a hashtable of the logger's preferences using the static instance variables in LoggerStateHashKeys as keys. |
java.lang.String |
getName()
Retrieves the name of this logger. |
Plugin |
getPlugin()
Retrieves the Plugin that this logger belongs, if running within a plugin environment. |
boolean |
getRotationalLogging()
Returns 'true' if rotational logging is turned ON, otherwise false is returned |
java.lang.String |
getVersion()
Retrieves the version of this logger. |
int |
getXMLDepth()
Gets the maximum number of referenced complex objects traversed when generating the Common Base Event XML fragment. |
int |
getXMLDetailLevel()
Deprecated. As of May 25, 2004, the level of detail is the same for all generated Common Base Events. |
boolean |
getXMLFormat()
Determines whether this logger is using XML as it's output format. |
protected void |
initialize(java.lang.String name)
Bring up the agent mechanism and sets any preferences that are stored in environment variable(s) (lowest priority) and/or the plugin's plugin.xml file that this logger belongs, if running within a plugin environment. |
protected void |
initialize(java.lang.String name,
java.lang.String version)
Bring up the agent mechanism and sets any preferences that are stored in environment variable(s) (lowest priority) and/or the plugin's plugin.xml file that this logger belongs, if running within a plugin environment. |
boolean |
isActive()
Checks if the logger is actively logging or turned 'on'. |
boolean |
isLogging()
Checks if the current logging level is set to log information. |
boolean |
isLoggingLevel(int checkLevel)
Checks if the current logging level is at the parameter check level or higher (i.e. |
boolean |
isMonitored()
Checks if the logger is being monitored. |
static java.lang.String |
printStackToString(java.lang.Throwable throwable)
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. |
void |
setActive(boolean active)
This method sets the flag that turns the logger 'on' for active logging or 'off' for no logging. |
void |
setArchiveExpiryDays(int _archiveExpiryDays)
Sets the number of days since an archived file was archived and its deletion. |
void |
setArchiveOnOff(boolean archiveOnOff)
Sets the archiveOnOff instance variable |
void |
setFileName(java.lang.String logFile)
This method sets the file name where messages are to be logged. |
void |
setFormatXMLOutput(boolean formatXMLOutput)
Sets whether XML log message strings are formatted (i.e. |
void |
setIncludeTimeStamp(boolean includeTimeStamp)
Deprecated. As of May 25, 2004, time stamps are included in all generated Common Base Events. |
void |
setLevel(int newLevel)
Set the level of logging to one of the eight levels (i.e. |
void |
setMaxSize(long size)
Sets the maximum size of the log file used for rotational logging. |
void |
setMsgLoggerConfig(java.util.Hashtable msgLoggerConfig)
Sets the logger's preferences based on values in the parameter hashtable. |
protected void |
setPlugin(Plugin plugin)
Set the Plugin that this logger belongs, if running within a plugin environment. |
void |
setXMLDepth(int newDepth)
Sets the maximum number of referenced complex objects traversed when generating the Common Base Event XML fragment. |
void |
setXMLDetailLevel(int xmlDetailLevel)
Deprecated. As of May 25, 2004, the level of detail is the same for all generated Common Base Events. |
void |
setXMLFormat(boolean format)
Sets whether this logger is using XML as it's output format. |
void |
turnRLOff()
Turns OFF rotational logging. |
boolean |
waitUntilMonitored(long maxTime)
Suspends the current thread until the logging agent is monitored or the the parameter maximum time (milliseconds) has expired. |
void |
write(boolean msg)
Log a boolean message. |
void |
write(byte msg)
Log a byte message. |
void |
write(char msg)
Log a char message. |
void |
write(DefaultRecord defaultRecord)
Log a DefaultRecord object and respect its current logging level. |
void |
write(double msg)
Log a double message. |
void |
write(float msg)
Log a float message. |
void |
write(int msg)
Log an int message. |
void |
write(int logLevel,
boolean msg)
Log a boolean message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(int logLevel,
byte msg)
Log a byte message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(int logLevel,
char msg)
Log a char message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(int logLevel,
double msg)
Log a double message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(int logLevel,
float msg)
Log a float message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(int logLevel,
int msg)
Log an int message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(int logLevel,
long msg)
Log a long message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(int logLevel,
java.lang.Object obj)
Log an object message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(int logLevel,
short msg)
Log a short message if the current logging level is at the parameter check level or higher (i.e. |
void |
write(long msg)
Log a long message. |
void |
write(java.lang.Object obj)
Log an Object message. |
void |
write(short msg)
Log a short message. |
void |
writeCurrentThread()
Log the current thread. |
void |
writeStackTrace()
Log a stack trace of the current thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String abstractMessageLoggerCopyright
protected static AbstractMessageLoggerFactory _factory
Constructor Detail |
public AbstractMessageLogger()
Method Detail |
public static AbstractMessageLoggerFactory getFactory() throws NoDefinedFactoryException
NoDefinedFactoryException
protected final void initialize(java.lang.String name) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- Attempting to set a logger's name with an illegal nameprotected final void initialize(java.lang.String name, java.lang.String version) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- Attempting to set a logger's name with an illegal namepublic void setXMLDetailLevel(int xmlDetailLevel)
As such, this method does nothing.
xmlDetailLevel
- Unused parameter.public int getXMLDetailLevel()
As such, this method always returns Detail.ALL
.
public boolean getIncludeTimeStamp()
creationTime
property, time
stamps are included in all generated Common Base Events.
As such, this method always returns true
.
public void setIncludeTimeStamp(boolean includeTimeStamp)
creationTime
property, time
stamps are included in all generated Common Base Events.
As such, this method does nothing.
includeTimeStamp
- Unused parameter.public static java.lang.String printStackToString(java.lang.Throwable throwable)
protected void checkEnvironment()
public final AgentConfiguration getLoggingAgentDefaultConfiguration()
public final void finalize()
finalize
in class java.lang.Object
public boolean isMonitored()
public boolean waitUntilMonitored(long maxTime)
maxTime
- the maximum amount of time (milliseconds) to suspend the current thread
public final boolean isLogging()
public final boolean isLoggingLevel(int checkLevel)
checkLevel
- level to be checked against the current level.
public void write(int logLevel, boolean msg)
logLevel
- the level to be checked against the current levelmsg
- the message to be loggedpublic void write(boolean msg)
msg
- the message to be loggedpublic void write(int logLevel, char msg)
logLevel
- the level to be checked against the current levelmsg
- the message to be loggedpublic void write(char msg)
msg
- the message to be loggedpublic void write(int logLevel, byte msg)
logLevel
- the level to be checked against the current levelmsg
- the message to be loggedpublic void write(byte msg)
msg
- the message to be loggedpublic void write(int logLevel, short msg)
logLevel
- the level to be checked against the current levelmsg
- the message to be loggedpublic void write(short msg)
msg
- the message to be loggedpublic void write(int logLevel, int msg)
logLevel
- the level to be checked against the current levelmsg
- the message to be loggedpublic void write(int msg)
msg
- the message to be loggedpublic void write(int logLevel, long msg)
logLevel
- the level to be checked against the current levelmsg
- the message to be loggedpublic void write(long msg)
msg
- the message to be loggedpublic void write(int logLevel, float msg)
logLevel
- the level to be checked against the current levelmsg
- the message to be loggedpublic void write(float msg)
msg
- the message to be loggedpublic void write(int logLevel, double msg)
logLevel
- the level to be checked against the current levelmsg
- the message to be loggedpublic void write(double msg)
msg
- the message to be loggedpublic void write(DefaultRecord defaultRecord)
defaultRecord
- the DefaultRecord object to be loggedpublic void write(int logLevel, java.lang.Object obj)
logLevel
- the level to be checked against the current levelpublic void write(java.lang.Object obj)
public final void writeCurrentThread()
public final void writeStackTrace()
public java.util.Hashtable getMsgLoggerConfig()
public void setMsgLoggerConfig(java.util.Hashtable msgLoggerConfig)
msgLoggerConfig
- hashtable of the logger's preferencespublic final int getArchiveExpiryDays()
public final void setArchiveExpiryDays(int _archiveExpiryDays)
_archiveExpiryDays
- the number of days before archived files are deletedpublic final boolean getFormatXMLOutput()
public final void setFormatXMLOutput(boolean formatXMLOutput)
formatXMLOutput
- if XML log message strings are formattedpublic final void setMaxSize(long size)
size
- - The maximum size of the log file in bytespublic final void turnRLOff()
public final boolean getRotationalLogging()
public final Plugin getPlugin()
protected final void setPlugin(Plugin plugin)
plugin
- the Plugin that this logger belongspublic final java.lang.String getName()
public final java.lang.String getVersion()
public final void setLevel(int newLevel) throws java.lang.IllegalArgumentException
newLevel
- new level of logging (i.e. LEVEL.FINEST - Level.NONE)
java.lang.IllegalArgumentException
- Attempting to set an illegal levelpublic final int getLevel()
public void setXMLDepth(int newDepth)
The following ranges exist:
newDepth
- The new maximum number of referenced complex objects traversedpublic int getXMLDepth()
The following ranges exist:
public void setXMLFormat(boolean format)
format
- if this logger is using XML as it's output formatpublic boolean getXMLFormat()
public java.lang.String getFileName()
public void setFileName(java.lang.String logFile)
logFile
- new file namepublic void closeFile()
public final boolean isActive()
public void setActive(boolean active)
active
- boolean flag that turns the logger 'on' or 'off'public void setArchiveOnOff(boolean archiveOnOff)
archiveOnOff
- boolean flag that turns archiving 'on' or 'off'public boolean getArchiveOnOff()
public void archiveFile()
public void delArchivedFiles()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |