|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.log4j.Layout
org.riotfamily.common.log.FreeMarkerLayout
public class FreeMarkerLayout
Log4J Layout that uses a FreeMarker template to do the formatting.
The actual formatting is deferred until getFooter() is invoked,
therefore this layout is only suitable for certain appenders like the
SmartSmtpAppender.
| Nested Class Summary | |
|---|---|
static class |
FreeMarkerLayout.MacroHelper
|
| Field Summary |
|---|
| Fields inherited from class org.apache.log4j.Layout |
|---|
LINE_SEP, LINE_SEP_LEN |
| Constructor Summary | |
|---|---|
FreeMarkerLayout()
|
|
| Method Summary | |
|---|---|
void |
activateOptions()
|
String |
format(org.apache.log4j.spi.LoggingEvent event)
Adds the event to the model for later processing and returns an empty String. |
String |
getContentType()
|
String |
getFooter()
Processes the template and returns the formatted output. |
String |
getHeader()
(Re-)initializes the model map. |
boolean |
ignoresThrowable()
|
void |
setContentType(String contentType)
Sets the contentType that will be returned by getContentType(). |
void |
setTemplate(String templateName)
Sets the location in the classpath of the template to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FreeMarkerLayout()
| Method Detail |
|---|
public void setContentType(String contentType)
getContentType().
Default is text/html.
public void setTemplate(String templateName)
/org/riotfamily/common/log/layout.ftl.
public void activateOptions()
public String getContentType()
getContentType in class org.apache.log4j.Layoutpublic String getHeader()
null.
getHeader in class org.apache.log4j.Layoutpublic String format(org.apache.log4j.spi.LoggingEvent event)
format in class org.apache.log4j.Layoutpublic String getFooter()
getFooter in class org.apache.log4j.Layoutpublic boolean ignoresThrowable()
ignoresThrowable in class org.apache.log4j.Layout
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||