Log4j 1.3alpha0

org.apache.log4j
Class EnhancedHTMLLayout

java.lang.Object
  |
  +--org.apache.log4j.Layout
        |
        +--org.apache.log4j.EnhancedHTMLLayout
All Implemented Interfaces:
OptionHandler

public class EnhancedHTMLLayout
extends Layout

Version:
1.0
Author:
Steve Mactaggart

Field Summary
protected  int BUF_SIZE
           
static String DEFAULT_CONVERSION_PATTERN
          Default pattern string for log output.
protected  int MAX_CAPACITY
           
static String TTCC_CONVERSION_PATTERN
          A conversion pattern equivalent to the TTCCCLayout.
 
Fields inherited from class org.apache.log4j.Layout
charArrayWriter, ignoresThrowable, LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
EnhancedHTMLLayout()
          Constructs a PatternLayout using the DEFAULT_LAYOUT_PATTERN.
EnhancedHTMLLayout(String pattern)
          Constructs a PatternLayout using the supplied conversion pattern.
 
Method Summary
 void activateOptions()
          Does not do anything as options become effective
protected  PatternParser createPatternParser(String pattern)
          Returns PatternParser used to parse the conversion string.
 void format(Writer output, LoggingEvent event)
           
 String getContentType()
          Returns the content type output by this layout, i.e "text/html".
 String getConversionPattern()
          Returns the value of the ConversionPattern option.
 String getFooter()
          Returns the appropriate HTML footers.
 String getHeader()
          Returns appropriate HTML headers.
 String getHighlightLineColor()
           
 String getTitle()
          Returns the current value of the Title option.
 boolean ignoresThrowable()
          The HTML layout handles the throwable contained in logging events.
 void setConversionPattern(String conversionPattern)
          Set the ConversionPattern option.
 void setHighlightLineColor(String highlightLineColor)
           
 void setTitle(String title)
          The Title option takes a String value.
 
Methods inherited from class org.apache.log4j.Layout
format, setFooter, setHeader, setIgnoresThrowable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONVERSION_PATTERN

public static final String DEFAULT_CONVERSION_PATTERN
Default pattern string for log output. Currently set to the string "%m" which just prints the application supplied message.

See Also:
Constant Field Values

TTCC_CONVERSION_PATTERN

public static final String TTCC_CONVERSION_PATTERN
A conversion pattern equivalent to the TTCCCLayout. Current value is %r%t%p%c%x%m.

See Also:
Constant Field Values

BUF_SIZE

protected final int BUF_SIZE
See Also:
Constant Field Values

MAX_CAPACITY

protected final int MAX_CAPACITY
See Also:
Constant Field Values
Constructor Detail

EnhancedHTMLLayout

public EnhancedHTMLLayout()
Constructs a PatternLayout using the DEFAULT_LAYOUT_PATTERN. The default pattern just produces the application supplied message.


EnhancedHTMLLayout

public EnhancedHTMLLayout(String pattern)
Constructs a PatternLayout using the supplied conversion pattern.

Method Detail

setConversionPattern

public void setConversionPattern(String conversionPattern)
Set the ConversionPattern option. This is the string which controls formatting and consists of a mix of literal content and conversion specifiers.


getConversionPattern

public String getConversionPattern()
Returns the value of the ConversionPattern option.


activateOptions

public void activateOptions()
Does not do anything as options become effective


createPatternParser

protected PatternParser createPatternParser(String pattern)
Returns PatternParser used to parse the conversion string. Subclasses may override this to return a subclass of PatternParser which recognize custom conversion characters.

Since:
0.9.0

setTitle

public void setTitle(String title)
The Title option takes a String value. This option sets the document title of the generated HTML document.

Defaults to 'Log4J Log Messages'.


getTitle

public String getTitle()
Returns the current value of the Title option.


getContentType

public String getContentType()
Returns the content type output by this layout, i.e "text/html".

Overrides:
getContentType in class Layout

getHeader

public String getHeader()
Returns appropriate HTML headers.

Overrides:
getHeader in class Layout

getFooter

public String getFooter()
Returns the appropriate HTML footers.

Overrides:
getFooter in class Layout

ignoresThrowable

public boolean ignoresThrowable()
The HTML layout handles the throwable contained in logging events. Hence, this method return false.

Overrides:
ignoresThrowable in class Layout

getHighlightLineColor

public String getHighlightLineColor()
Returns:
Returns the highlightLineColor.

setHighlightLineColor

public void setHighlightLineColor(String highlightLineColor)
Parameters:
highlightLineColor - The highlightLineColor to set.

format

public void format(Writer output,
                   LoggingEvent event)
            throws IOException
Specified by:
format in class Layout
IOException
See Also:
Layout.format(java.io.Writer, org.apache.log4j.spi.LoggingEvent)

Log4j 1.3alpha0

Copyright 2000-2003 Apache Software Foundation.