Package org.apache.log4j
Class SimpleLayout
- java.lang.Object
-
- org.apache.log4j.Layout
-
- org.apache.log4j.SimpleLayout
-
- All 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- Since:
- version 0.7.0
PatternLayoutoffers a much more powerful alternative. - Author:
- Ceki Gülcü
-
-
Field Summary
-
Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN
-
-
Constructor Summary
Constructors Constructor Description SimpleLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateOptions()Activate the options that were previously set with calls to option setters.java.lang.Stringformat(LoggingEvent event)Returns the log statement in a format consisting of thelevel, followed by " - " and then themessage.booleanignoresThrowable()The SimpleLayout does not handle the throwable contained withinLoggingEvents.-
Methods inherited from class org.apache.log4j.Layout
getContentType, getFooter, getHeader
-
-
-
-
Method Detail
-
activateOptions
public void activateOptions()
Description copied from interface:OptionHandlerActivate the options that were previously set with calls to option setters.This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.
For example, the FileAppender has the
FileandAppendoptions both of which are ambigous until the other is also set.
-
format
public java.lang.String format(LoggingEvent event)
Returns the log statement in a format consisting of thelevel, followed by " - " and then themessage. For example,INFO - "A message"The
categoryparameter is ignored.
-
ignoresThrowable
public boolean ignoresThrowable()
The SimpleLayout does not handle the throwable contained withinLoggingEvents. Thus, it returnstrue.- Specified by:
ignoresThrowablein classLayout- Since:
- version 0.8.4
-
-