|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.bowstreet.appserver.logmanager.LogEvent
public class LogEvent
Users call the public static method of this class to log message.
Usage Notes:
In strings passed to any of the writeLogFormatted methods, single quotes
can be used to quote the "{" (curly brace) if necessary. A real single
quote is represented by ''. This is required by java.text.MessageFormat.
| Method Summary | |
|---|---|
static boolean |
okToWrite(int severity,
int component)
check if a specific combination of severity and component will be loged. |
static void |
writeLogEntry(int severity,
int component,
java.lang.String msg)
write an event log. |
static void |
writeLogEntry(int severity,
int component,
java.lang.Throwable thr)
This is a method to allow logging of exceptions and errors. |
static void |
writeLogEntry(java.lang.String str)
write an event log with severity=information and component=unknown. |
static void |
writeLogEntryMsgWithThrowable(int severity,
int component,
java.lang.String msg,
java.lang.Throwable thr)
Log a message with an accompaning stack trace. |
static void |
writeLogEntryResourceWithThrowable(int severity,
int component,
java.lang.String resourceId,
java.lang.Throwable thr)
Log a message identified by a resource id with an accompaning stack trace. |
static void |
writeLogFormatted(int severity,
int component,
java.lang.String strID)
write an event log. |
static void |
writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1)
A convenience method for writing a formatted message without instantiating a LogEvent object. |
static void |
writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object[] args)
write an event log. |
static void |
writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1,
java.lang.Object arg2)
A convenience method for writing a formatted message without instantiating a LogEvent object. |
static void |
writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
A convenience method for writing a formatted message without instantiating a LogEvent object. |
static void |
writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
A convenience method for writing a formatted message without instantiating a LogEvent object. |
static void |
writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5)
A convenience method for writing a formatted message without instantiating a LogEvent object. |
static void |
writeLogFormatted(int severity,
java.lang.String provider,
int component,
java.lang.String strID,
java.lang.Object[] args,
java.lang.Object logProducer,
boolean isThreadNameRecorded)
the most complete method for writing a formatted message without instantiating a LogEvent object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean okToWrite(int severity,
int component)
severity - The severity associated with the log event.component - The component in which the log event occurred.
public static void writeLogEntry(int severity,
int component,
java.lang.String msg)
severity - The severity associated with the event.component - The component in which the event occurred.msg - the message need to recorded.Severity,
Component
public static void writeLogEntry(int severity,
int component,
java.lang.Throwable thr)
severity - The severity associated with the log event.component - The component in which the log event occurred.thr - The Throwable object to be loggedSeverity,
Componentpublic static void writeLogEntry(java.lang.String str)
public static void writeLogEntryMsgWithThrowable(int severity,
int component,
java.lang.String msg,
java.lang.Throwable thr)
Format looks like:
*-- TIME: [Fri Nov 17 11:05:11 EST 2000] --*
Severity: SEVERE
Component: ADMIN
MSG: "EventManager: error trimming event store
Exception: com.bowstreet.util.xml.XmlDOMException: Not a child of node
at com.bowstreet.util.xml.XmlElement.removeChild(XmlElement.java:381)
....
severity - The severity associated with the event.component - The component in which the event occurred.msg - String message that summarizes the errorthr - The Throwable object to be loggedSeverity,
Component
public static void writeLogEntryResourceWithThrowable(int severity,
int component,
java.lang.String resourceId,
java.lang.Throwable thr)
Format looks like:
*-- TIME: [Fri Nov 17 11:05:11 EST 2000] --*
Severity: SEVERE
Component: ADMIN
MSG: "EventManager: error trimming event store
Exception: com.bowstreet.util.xml.XmlDOMException: Not a child of node
at com.bowstreet.util.xml.XmlElement.removeChild(XmlElement.java:381)
....
severity - The severity associated with the event.component - The component in which the event occurred.resourceId - resourceID identifies the msg text to be logged. resourceID must be found
in the LogManagerBundle.properties.thr - The Throwable object to be loggedSeverity,
Component
public static void writeLogFormatted(int severity,
int component,
java.lang.String strID)
severity - The severity associated with the event.component - The component in which the event occurred.strID - The key for the message in the resource bundleSeverity,
Component
public static void writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1)
severity - The severity associated with the log event.component - The component in which the log event occurred.strID - The key for the message in the resource bundlearg1 - The argument the string needs for formattingSeverity,
Component,
writeLogFormatted(int, int, String, Object[])
public static void writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object[] args)
severity - The severity associated with the event.component - The component in which the event occurred.strID - The key for the message in the resource bundleargs - Any arguments the string may need for formattingSeverity,
Component
public static void writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1,
java.lang.Object arg2)
severity - The severity associated with the log event.component - The component in which the log event occurred.strID - The key for the message in the resource bundlearg1 - The arguments the string needs for formattingarg2 - The arguments the string needs for formattingwriteLogFormatted(long, String, Object[])
public static void writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
severity - The severity associated with the log event.component - The component in which the log event occurred.strID - The key for the message in the resource bundlearg1 - The arguments the string needs for formattingarg2 - The arguments the string needs for formattingarg3 - The arguments the string needs for formattingSeverity,
Component
public static void writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
severity - The severity associated with the log event.component - The component in which the log event occurred.strID - The key for the message in the resource bundlearg1 - The arguments the string needs for formattingarg2 - The arguments the string needs for formattingarg3 - The arguments the string needs for formattingarg4 - The arguments the string needs for formattingSeverity,
Component
public static void writeLogFormatted(int severity,
int component,
java.lang.String strID,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5)
severity - The severity associated with the log event.component - The component in which the log event occurred.strID - The key for the message in the resource bundlearg1 - The arguments the string needs for formattingarg2 - The arguments the string needs for formattingarg3 - The arguments the string needs for formattingarg4 - The arguments the string needs for formattingarg5 - The arguments the string needs for formattingwriteLogFormatted(long, String, Object[])
public static void writeLogFormatted(int severity,
java.lang.String provider,
int component,
java.lang.String strID,
java.lang.Object[] args,
java.lang.Object logProducer,
boolean isThreadNameRecorded)
severity - The severity associated with the log event.provider - provider of the componentcomponent - The component in which the log event occurred.strID - The key for the message in the resource bundleargs - Any arguments the string may need for formattinglogProducer - the producer of this log, usually pass a "this" reference.isThreadNameRecorded - do you want to record the name of current threadSeverity,
Component
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||