|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.log4j.lf5.util.LogMonitorAdapter
public class LogMonitorAdapter
LogMonitorAdapter facilitates the usage of the LogMonitor
Field Summary | |
---|---|
static int |
JDK14_LOG_LEVELS
|
static int |
LOG4J_LOG_LEVELS
|
Method Summary | |
---|---|
void |
addMessage(LogRecord record)
Adds a LogRecord to the LogMonitor. |
LogLevel |
getDefaultLevel()
Gets the default LogLevel for the Adapter. |
protected static int |
getDefaultMonitorHeight()
|
protected static int |
getDefaultMonitorWidth()
|
protected static int |
getScreenHeight()
|
protected static int |
getScreenWidth()
|
LogLevel |
getSevereLevel()
Gets the current Severe LogLevel |
void |
log(String category,
LogLevel level,
String message)
Log a message to the Monitor. |
void |
log(String category,
LogLevel level,
String message,
String NDC)
Log a message to the Monitor. |
void |
log(String category,
LogLevel level,
String message,
Throwable t)
Log a message to the Monitor. |
void |
log(String category,
LogLevel level,
String message,
Throwable t,
String NDC)
Log a complete message to the Monitor. |
void |
log(String category,
String message)
Log a message to the Monitor and use the default LogLevel. |
static LogMonitorAdapter |
newInstance(int loglevels)
Creates an instance of LogMonitorAdapter using the log levels inticated by the parameter. |
static LogMonitorAdapter |
newInstance(List userDefinedLevels)
Creates an instance of LogMonitorAdapter using the specified LogLevels. |
static LogMonitorAdapter |
newInstance(LogLevel[] userDefined)
Creates an instance of LogMonitorAdapter using the specified LogLevels. |
void |
setDefaultLevel(LogLevel level)
Set the default log level to be used when logging messages without specifying a LogLevel. |
void |
setMaxNumberOfRecords(int maxNumberOfRecords)
Set the maximum number of records to be displayed in the monitor |
void |
setSevereLevel(LogLevel level)
Sets the Severe LogLevel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LOG4J_LOG_LEVELS
public static final int JDK14_LOG_LEVELS
Method Detail |
---|
public static LogMonitorAdapter newInstance(int loglevels)
Creates an instance of LogMonitorAdapter using the log levels inticated by the parameter. Log4J and JDK1.4 both have default LogLevels which are set but these levels can be overriden.
loglevels
- An integer representing either Log4J or JDK1.4 logging levels
public static LogMonitorAdapter newInstance(LogLevel[] userDefined)
Creates an instance of LogMonitorAdapter using the specified LogLevels. The first LogLevel in the array is used as the default LogLevel unless changed using the setDefaultLevel method.
userDefined
- An array of user defined LogLevel objects.
public static LogMonitorAdapter newInstance(List userDefinedLevels)
Creates an instance of LogMonitorAdapter using the specified LogLevels. The first LogLevel in the List is used as the default LogLevel unless changed using the setDefaultLevel method.
userDefinedLevels
- A list of user defined LogLevel objects.
public void addMessage(LogRecord record)
Adds a LogRecord to the LogMonitor.
record
- The LogRecord object to be logged in the logging monitor.public void setMaxNumberOfRecords(int maxNumberOfRecords)
Set the maximum number of records to be displayed in the monitor
maxNumberOfRecords
- public void setDefaultLevel(LogLevel level)
Set the default log level to be used when logging messages without specifying a LogLevel.
level
- public LogLevel getDefaultLevel()
Gets the default LogLevel for the Adapter.
public void setSevereLevel(LogLevel level)
Sets the Severe LogLevel.
level
- public LogLevel getSevereLevel()
Gets the current Severe LogLevel
public void log(String category, LogLevel level, String message, Throwable t, String NDC)
Log a complete message to the Monitor.
category
- The category to be usedlevel
- The log level to apply to the messagemessage
- The messaget
- The throwable content of the messageNDC
- The NDC really only applies to Log4J and the parameter can
usually be ignored.public void log(String category, String message)
Log a message to the Monitor and use the default LogLevel.
category
- The category to be usedmessage
- The messagepublic void log(String category, LogLevel level, String message, String NDC)
Log a message to the Monitor.
category
- The category to be usedlevel
- The log level to apply to the messagemessage
- The messageNDC
- public void log(String category, LogLevel level, String message, Throwable t)
Log a message to the Monitor.
category
- The category to be usedlevel
- The log level to apply to the messagemessage
- The messaget
- The throwable content of the messagepublic void log(String category, LogLevel level, String message)
Log a message to the Monitor.
category
- The category to be usedlevel
- The log level to apply to the messagemessage
- The messageprotected static int getScreenWidth()
Toolkit
protected static int getScreenHeight()
Toolkit
protected static int getDefaultMonitorWidth()
protected static int getDefaultMonitorHeight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |