org.apache.log4j

Class SimpleLayout

Implemented Interfaces:
OptionHandler

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

PatternLayout offers a much more powerful alternative.

Field Summary

Fields inherited from class org.apache.log4j.Layout

LINE_SEP, LINE_SEP_LEN

Constructor Summary

SimpleLayout()

Method Summary

void
activateOptions()
String
format(LoggingEvent event)
Returns the log statement in a format consisting of the level, followed by " - " and then the message.
boolean
ignoresThrowable()
The SimpleLayout does not handle the throwable contained within LoggingEvents.

Methods inherited from class org.apache.log4j.Layout

format, getContentType, getFooter, getHeader, ignoresThrowable

Constructor Details

SimpleLayout

public SimpleLayout()

Method Details

activateOptions

public void activateOptions()
Specified by:
activateOptions in interface OptionHandler

format

public String format(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.

Overrides:
format in interface Layout
Returns:
A byte array in SimpleLayout format.

ignoresThrowable

public boolean ignoresThrowable()
Overrides:
ignoresThrowable in interface Layout
Since:
version 0.8.4

Copyright 2000-2005 Apache Software Foundation.