FileDocCategorySizeDatePackage
SimpleLayout.javaAPI DocApache log4j 1.2.152176Sat Aug 25 00:09:42 BST 2007org.apache.log4j

SimpleLayout

public class SimpleLayout extends Layout
SimpleLayout consists of the level of the log statement, followed by " - " and then the log message itself. For example,
DEBUG - Hello world

author
Ceki Gülcü
since
version 0.7.0

{@link PatternLayout} offers a much more powerful alternative.

Fields Summary
StringBuffer
sbuf
Constructors Summary
public SimpleLayout()


    
  
Methods Summary
public voidactivateOptions()

  
public java.lang.Stringformat(org.apache.log4j.spi.LoggingEvent event)
Returns the log statement in a format consisting of the level, followed by " - " and then the message. For example,
 INFO - "A message"

The category parameter is ignored.

return
A byte array in SimpleLayout format.


    sbuf.setLength(0);
    sbuf.append(event.getLevel().toString());
    sbuf.append(" - ");
    sbuf.append(event.getRenderedMessage());
    sbuf.append(LINE_SEP);
    return sbuf.toString();
  
public booleanignoresThrowable()
The SimpleLayout does not handle the throwable contained within {@link LoggingEvent LoggingEvents}. Thus, it returns true.

since
version 0.8.4

    return true;