Methods Summary |
---|
public void | addMessage(org.apache.log4j.lf5.LogRecord record)Adds a LogRecord to the LogMonitor.
_logMonitor.addMessage(record);
|
public org.apache.log4j.lf5.LogLevel | getDefaultLevel()Gets the default LogLevel for the Adapter.
return _defaultLevel;
|
protected static int | getDefaultMonitorHeight()
return (3 * getScreenHeight()) / 4;
|
protected static int | getDefaultMonitorWidth()
return (3 * getScreenWidth()) / 4;
|
protected static int | getScreenHeight()
try {
return Toolkit.getDefaultToolkit().getScreenSize().height;
} catch (Throwable t) {
return 600;
}
|
protected static int | getScreenWidth()
try {
return Toolkit.getDefaultToolkit().getScreenSize().width;
} catch (Throwable t) {
return 800;
}
|
public org.apache.log4j.lf5.LogLevel | getSevereLevel()Gets the current Severe LogLevel
return AdapterLogRecord.getSevereLevel();
|
public void | log(java.lang.String category, org.apache.log4j.lf5.LogLevel level, java.lang.String message, java.lang.Throwable t, java.lang.String NDC)Log a complete message to the Monitor.
AdapterLogRecord record = new AdapterLogRecord();
record.setCategory(category);
record.setMessage(message);
record.setNDC(NDC);
record.setThrown(t);
if (level == null) {
record.setLevel(getDefaultLevel());
} else {
record.setLevel(level);
}
addMessage(record);
|
public void | log(java.lang.String category, java.lang.String message)Log a message to the Monitor and use the default LogLevel.
log(category, null, message);
|
public void | log(java.lang.String category, org.apache.log4j.lf5.LogLevel level, java.lang.String message, java.lang.String NDC)Log a message to the Monitor.
log(category, level, message, null, NDC);
|
public void | log(java.lang.String category, org.apache.log4j.lf5.LogLevel level, java.lang.String message, java.lang.Throwable t)Log a message to the Monitor.
log(category, level, message, t, null);
|
public void | log(java.lang.String category, org.apache.log4j.lf5.LogLevel level, java.lang.String message)Log a message to the Monitor.
log(category, level, message, null, null);
|
public static org.apache.log4j.lf5.util.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.
LogMonitorAdapter adapter;
if (loglevels == JDK14_LOG_LEVELS) {
adapter = newInstance(LogLevel.getJdk14Levels());
adapter.setDefaultLevel(LogLevel.FINEST);
adapter.setSevereLevel(LogLevel.SEVERE);
} else {
adapter = newInstance(LogLevel.getLog4JLevels());
adapter.setDefaultLevel(LogLevel.DEBUG);
adapter.setSevereLevel(LogLevel.FATAL);
}
return adapter;
|
public static org.apache.log4j.lf5.util.LogMonitorAdapter | newInstance(org.apache.log4j.lf5.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.
if (userDefined == null) {
return null;
}
return newInstance(Arrays.asList(userDefined));
|
public static org.apache.log4j.lf5.util.LogMonitorAdapter | newInstance(java.util.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.
return new LogMonitorAdapter(userDefinedLevels);
|
public void | setDefaultLevel(org.apache.log4j.lf5.LogLevel level)Set the default log level to be used when logging messages without
specifying a LogLevel.
_defaultLevel = level;
|
public void | setMaxNumberOfRecords(int maxNumberOfRecords)Set the maximum number of records to be displayed in the monitor
_logMonitor.setMaxNumberOfLogRecords(maxNumberOfRecords);
|
public void | setSevereLevel(org.apache.log4j.lf5.LogLevel level)Sets the Severe LogLevel.
AdapterLogRecord.setSevereLevel(level);
|