Save This Page
Home » apache-log4j-1.2.15 » org.apache » log4j » [javadoc | source]
org.apache.log4j
public class: HTMLLayout [javadoc | source]
java.lang.Object
   org.apache.log4j.Layout
      org.apache.log4j.HTMLLayout

All Implemented Interfaces:
    OptionHandler

This layout outputs events in a HTML table. Appenders using this layout should have their encoding set to UTF-8 or UTF-16, otherwise events containing non ASCII characters could result in corrupted log files.
Field Summary
protected final  int BUF_SIZE     
protected final  int MAX_CAPACITY     
static  String TRACE_PREFIX     
public static final  String LOCATION_INFO_OPTION    A string constant used in naming the option for setting the the location information flag. Current value of this string constant is LocationInfo.

Note that all option keys are case sensitive.

     
    public static final  String TITLE_OPTION    A string constant used in naming the option for setting the the HTML document title. Current value of this string constant is Title
     boolean locationInfo     
     String title     
    Fields inherited from org.apache.log4j.Layout:
    LINE_SEP,  LINE_SEP_LEN
    Method from org.apache.log4j.HTMLLayout Summary:
    activateOptions,   appendThrowableAsHTML,   format,   getContentType,   getFooter,   getHeader,   getLocationInfo,   getTitle,   ignoresThrowable,   setLocationInfo,   setTitle
    Methods from org.apache.log4j.Layout:
    format,   getContentType,   getFooter,   getHeader,   ignoresThrowable
    Methods from java.lang.Object:
    equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
    Method from org.apache.log4j.HTMLLayout Detail:
     public  void activateOptions() 
      No options to activate.
      void appendThrowableAsHTML(String[] s,
        StringBuffer sbuf) 
     public String format(LoggingEvent event) 
     public String getContentType() 
      Returns the content type output by this layout, i.e "text/html".
     public String getFooter() 
      Returns the appropriate HTML footers.
     public String getHeader() 
      Returns appropriate HTML headers.
     public boolean getLocationInfo() 
      Returns the current value of the LocationInfo option.
     public String getTitle() 
      Returns the current value of the Title option.
     public boolean ignoresThrowable() 
      The HTML layout handles the throwable contained in logging events. Hence, this method return false.
     public  void setLocationInfo(boolean flag) 
      The LocationInfo option takes a boolean value. By default, it is set to false which means there will be no location information output by this layout. If the the option is set to true, then the file name and line number of the statement at the origin of the log statement will be output.

      If you are embedding this layout within an org.apache.log4j.net.SMTPAppender then make sure to set the LocationInfo option of that appender as well.

     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'.