Apache log4cxx  Version 0.13.0
log4cxx::Layout Class Referenceabstract

Extend this abstract class to create your own log layout format. More...

#include <layout.h>

Inheritance diagram for log4cxx::Layout:
log4cxx::spi::OptionHandler log4cxx::helpers::Object log4cxx::helpers::Object log4cxx::helpers::DateLayout log4cxx::HTMLLayout log4cxx::JSONLayout log4cxx::PatternLayout log4cxx::SimpleLayout log4cxx::xml::XMLLayout log4cxx::TTCCLayout

Public Member Functions

virtual ~Layout ()
 
virtual void format (LogString &output, const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool) const =0
 Implement this method to create your own layout format. More...
 
virtual LogString getContentType () const
 Returns the content type output by this layout. More...
 
virtual void appendHeader (LogString &output, log4cxx::helpers::Pool &p)
 Append the header for the layout format. More...
 
virtual void appendFooter (LogString &output, log4cxx::helpers::Pool &p)
 Append the footer for the layout format. More...
 
virtual bool ignoresThrowable () const =0
 If the layout handles the throwable object contained within LoggingEvent, then the layout should return false. More...
 
- Public Member Functions inherited from log4cxx::spi::OptionHandler
virtual ~OptionHandler ()
 
virtual void activateOptions (log4cxx::helpers::Pool &p)=0
 Activate the options that were previously set with calls to option setters. More...
 
virtual void setOption (const LogString &option, const LogString &value)=0
 Set option to value. More...
 
- Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
 
virtual bool instanceof (const Class &clazz) const =0
 
virtual const void * cast (const Class &clazz) const =0
 

Detailed Description

Extend this abstract class to create your own log layout format.

Constructor & Destructor Documentation

◆ ~Layout()

virtual log4cxx::Layout::~Layout ( )
virtual

Member Function Documentation

◆ appendFooter()

virtual void log4cxx::Layout::appendFooter ( LogString output,
log4cxx::helpers::Pool p 
)
virtual

Append the footer for the layout format.

The base class does nothing.

Reimplemented in log4cxx::HTMLLayout.

◆ appendHeader()

virtual void log4cxx::Layout::appendHeader ( LogString output,
log4cxx::helpers::Pool p 
)
virtual

Append the header for the layout format.

The base class does nothing.

Reimplemented in log4cxx::HTMLLayout.

◆ format()

virtual void log4cxx::Layout::format ( LogString output,
const spi::LoggingEventPtr event,
log4cxx::helpers::Pool pool 
) const
pure virtual

Implement this method to create your own layout format.

Implemented in log4cxx::PatternLayout, log4cxx::TTCCLayout, log4cxx::xml::XMLLayout, log4cxx::JSONLayout, log4cxx::HTMLLayout, and log4cxx::SimpleLayout.

◆ getContentType()

virtual LogString log4cxx::Layout::getContentType ( ) const
virtual

Returns the content type output by this layout.

The base class returns "text/plain".

Reimplemented in log4cxx::JSONLayout, and log4cxx::HTMLLayout.

◆ ignoresThrowable()

virtual bool log4cxx::Layout::ignoresThrowable ( ) const
pure virtual

If the layout handles the throwable object contained within LoggingEvent, then the layout should return false.

Otherwise, if the layout ignores throwable object, then the layout should return true.

The SimpleLayout, TTCCLayout, PatternLayout all return true. The XMLLayout returns false.

Implemented in log4cxx::PatternLayout, log4cxx::TTCCLayout, log4cxx::xml::XMLLayout, log4cxx::JSONLayout, log4cxx::HTMLLayout, and log4cxx::SimpleLayout.


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