Package org.apache.log4j.chainsaw.layout
Class EventDetailLayout
- java.lang.Object
-
- org.apache.log4j.Layout
-
- org.apache.log4j.chainsaw.layout.EventDetailLayout
-
- All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler
public class EventDetailLayout extends org.apache.log4j.LayoutThis layout is used for formatting HTML text for use inside the Chainsaw Event Detail Panel, and the tooltip used when mouse-over on a particular log event row.It relies an an internal PatternLayout to accomplish this, but ensures HTML characters from any LoggingEvent are escaped first.
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.log4j.EnhancedPatternLayoutpatternLayout
-
Constructor Summary
Constructors Constructor Description EventDetailLayout()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateOptions()private static org.apache.log4j.spi.LoggingEventcopyForHTML(org.apache.log4j.spi.LoggingEvent event)Takes a source event and copies it into a new LoggingEvent object and ensuring all the internal elements of the event are HTML safeprivate static java.lang.Stringescape(java.lang.String string)Escape <, > & and " as their entities.java.lang.Stringformat(org.apache.log4j.spi.LoggingEvent event)private static org.apache.log4j.spi.LocationInfoformatLocationInfo(org.apache.log4j.spi.LoggingEvent event)private static java.util.Hashtable<java.lang.String,java.lang.String>formatProperties(org.apache.log4j.spi.LoggingEvent event)java.lang.StringgetConversionPattern()java.lang.StringgetFooter()java.lang.StringgetHeader()booleanignoresThrowable()voidsetConversionPattern(java.lang.String conversionPattern)
-
-
-
Method Detail
-
setConversionPattern
public void setConversionPattern(java.lang.String conversionPattern)
-
getConversionPattern
public java.lang.String getConversionPattern()
-
getFooter
public java.lang.String getFooter()
- Overrides:
getFooterin classorg.apache.log4j.Layout
-
getHeader
public java.lang.String getHeader()
- Overrides:
getHeaderin classorg.apache.log4j.Layout
-
escape
private static java.lang.String escape(java.lang.String string)
Escape <, > & and " as their entities. It is very dumb about & handling.- Parameters:
aStr- the String to escape.- Returns:
- the escaped String
-
copyForHTML
private static org.apache.log4j.spi.LoggingEvent copyForHTML(org.apache.log4j.spi.LoggingEvent event)
Takes a source event and copies it into a new LoggingEvent object and ensuring all the internal elements of the event are HTML safe- Parameters:
event-- Returns:
- new LoggingEvent
-
formatLocationInfo
private static org.apache.log4j.spi.LocationInfo formatLocationInfo(org.apache.log4j.spi.LoggingEvent event)
- Parameters:
event-- Returns:
-
formatProperties
private static java.util.Hashtable<java.lang.String,java.lang.String> formatProperties(org.apache.log4j.spi.LoggingEvent event)
- Parameters:
event-- Returns:
-
ignoresThrowable
public boolean ignoresThrowable()
- Specified by:
ignoresThrowablein classorg.apache.log4j.Layout
-
activateOptions
public void activateOptions()
-
format
public java.lang.String format(org.apache.log4j.spi.LoggingEvent event)
- Specified by:
formatin classorg.apache.log4j.Layout
-
-