Apache Log4cxx  Version 2.0.0
Loading...
Searching...
No Matches
log4cxx::HTMLLayout Class Reference

This layout outputs events in a HTML table. More...

#include <htmllayout.h>

Inheritance diagram for log4cxx::HTMLLayout:
log4cxx::Layout log4cxx::spi::OptionHandler log4cxx::helpers::Object

Public Member Functions

 HTMLLayout ()
 ~HTMLLayout ()
void setLocationInfo (bool locationInfoFlag)
 The LocationInfo option takes a boolean value.
bool getLocationInfo () const
 Returns the current value of the LocationInfo option.
void setTitle (const LogString &title1)
 The Title option takes a String value.
const LogString & getTitle () const
 Returns the current value of the Title option.
LogString getContentType () const override
 Returns the content type output by this layout, i.e "text/html".
void setOption (const LogString &option, const LogString &value) override
 Set option to value.
void format (LogString &output, const spi::LoggingEventPtr &event) const override
 Append the attributes of event as a HTML table row onto output.
void appendHeader (LogString &output) override
 Append a HTML document header and start a HTML table with column headings that align with the output produced by HTMLLayout::format.
void appendFooter (LogString &output) override
 Terminate the HTML table and the HTML document.
bool ignoresThrowable () const override
 The HTML layout handles the throwable contained in logging events.
void activateOptions () override
 Activate the options that were previously set with calls to option setters.
void format (LogString &output, const spi::LoggingEventPtr &event, helpers::Pool &p) const
void appendHeader (LogString &output, helpers::Pool &p)
void appendFooter (LogString &output, helpers::Pool &p)
Public Member Functions inherited from log4cxx::Layout
virtual ~Layout ()
void format (LogString &output, const spi::LoggingEventPtr &event, helpers::Pool &p) const
void appendHeader (LogString &output, helpers::Pool &p)
void appendFooter (LogString &output, helpers::Pool &p)
void activateOptions () override
 Activate the options that were previously set with calls to option setters.
void activateOptions (helpers::Pool &)
Public Member Functions inherited from log4cxx::spi::OptionHandler
virtual ~OptionHandler ()
void activateOptions (helpers::Pool &)
Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
virtual const helpers::Class & getClass () const =0
virtual bool instanceof (const Class &clazz) const =0
virtual const void * cast (const Class &clazz) const =0

Additional Inherited Members

Protected Member Functions inherited from log4cxx::Layout
size_t getFormattedEventCharacterCount () const
 The expected length of a formatted event excluding the message text.

Detailed Description

This layout outputs events in a HTML table.

Constructor & Destructor Documentation

◆ HTMLLayout()

log4cxx::HTMLLayout::HTMLLayout ( )

◆ ~HTMLLayout()

log4cxx::HTMLLayout::~HTMLLayout ( )

Member Function Documentation

◆ activateOptions()

void log4cxx::Layout::activateOptions ( )
overridevirtual

Activate the options that were previously set with calls to option setters.

No action is performed in this implementation.

Implements log4cxx::spi::OptionHandler.

◆ appendFooter() [1/2]

void log4cxx::HTMLLayout::appendFooter ( LogString & output)
overridevirtual

Terminate the HTML table and the HTML document.

Reimplemented from log4cxx::Layout.

◆ appendFooter() [2/2]

Deprecated
Backward compatability support will be removed in a future version.
Deprecated
Use appendFooter() without a Pool parameter instead

◆ appendHeader() [1/2]

void log4cxx::HTMLLayout::appendHeader ( LogString & output)
overridevirtual

Append a HTML document header and start a HTML table with column headings that align with the output produced by HTMLLayout::format.

Reimplemented from log4cxx::Layout.

◆ appendHeader() [2/2]

Deprecated
Backward compatability support will be removed in a future version.
Deprecated
Use appendHeader() without a Pool parameter instead

◆ format() [1/2]

void log4cxx::HTMLLayout::format ( LogString & output,
const spi::LoggingEventPtr & event ) const
overridevirtual

Append the attributes of event as a HTML table row onto output.

Implements log4cxx::Layout.

◆ format() [2/2]

void log4cxx::Layout::format ( LogString & output,
const spi::LoggingEventPtr & event,
helpers::Pool & p ) const
Deprecated
Backward compatability support will be removed in a future version.
Deprecated
Use format() without a Pool parameter instead

◆ getContentType()

LogString log4cxx::HTMLLayout::getContentType ( ) const
overridevirtual

Returns the content type output by this layout, i.e "text/html".

Reimplemented from log4cxx::Layout.

◆ getLocationInfo()

bool log4cxx::HTMLLayout::getLocationInfo ( ) const

Returns the current value of the LocationInfo option.

◆ getTitle()

const LogString & log4cxx::HTMLLayout::getTitle ( ) const

Returns the current value of the Title option.

◆ ignoresThrowable()

bool log4cxx::HTMLLayout::ignoresThrowable ( ) const
overridevirtual

The HTML layout handles the throwable contained in logging events.

Hence, this method return false.

Implements log4cxx::Layout.

◆ setLocationInfo()

void log4cxx::HTMLLayout::setLocationInfo ( bool locationInfoFlag)

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 SMTPAppender then make sure to set the LocationInfo option of that appender as well.

◆ setOption()

void log4cxx::HTMLLayout::setOption ( const LogString & option,
const LogString & value )
overridevirtual

Set option to value.

Supported options Supported values Default value
Title {any} Log4cxx Log Messages
LocationInfo True,False False

Reimplemented from log4cxx::spi::OptionHandler.

◆ setTitle()

void log4cxx::HTMLLayout::setTitle ( const LogString & title1)

The Title option takes a String value.

This option sets the document title of the generated HTML document.

Defaults to 'Log4cxx Log Messages'.


The documentation for this class was generated from the following file: