FileDocCategorySizeDatePackage
Log4JLogRecord.javaAPI DocApache log4j 1.2.154092Sat Aug 25 00:09:38 BST 2007org.apache.log4j.lf5

Log4JLogRecord

public class Log4JLogRecord extends LogRecord
A Log4JLogRecord encapsulates the details of your log4j LoggingEvent in a format usable by the LogBrokerMonitor.
author
Brent Sprecher

Fields Summary
Constructors Summary
public Log4JLogRecord()
Constructs an instance of a Log4JLogRecord.

  
Methods Summary
public booleanisSevereLevel()
Determines which Priority levels will be displayed in colored font when the LogMonitorAppender renders this log message. By default, messages will be colored red if they are of Priority ERROR or FATAL.

return
true if the log level is ERROR or FATAL.

    boolean isSevere = false;

    if (LogLevel.ERROR.equals(getLevel()) ||
        LogLevel.FATAL.equals(getLevel())) {
      isSevere = true;
    }

    return isSevere;
  
public voidsetThrownStackTrace(org.apache.log4j.spi.ThrowableInformation throwableInfo)
Set stack trace information associated with this Log4JLogRecord. When this method is called, the stack trace in a String-based format is made available via the getThrownStackTrace() method.

param
throwableInfo An org.apache.log4j.spi.ThrowableInformation to associate with this Log4JLogRecord.
see
#getThrownStackTrace()

    String[] stackTraceArray = throwableInfo.getThrowableStrRep();

    StringBuffer stackTrace = new StringBuffer();
    String nextLine;

    for (int i = 0; i < stackTraceArray.length; i++) {
      nextLine = stackTraceArray[i] + "\n";
      stackTrace.append(nextLine);
    }

    _thrownStackTrace = stackTrace.toString();