Apache log4cxx Version @version@

Public Member Functions | List of all members
Layout Class Referenceabstract

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

`#include <layout.h>`

Inheritance diagram for Layout:

## Public Member Functions
virtual | ~Layout ()
void | addRef () const
void | releaseRef () const
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 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 Object
virtual const helpers::Class & | getClass () const
virtual | ~Object ()
virtual void | addRef () const =0
virtual void | releaseRef () const =0
virtual bool | instanceof (const Class &clazz) const =0
virtual const void * | cast (const Class &clazz) const =0
Public Member Functions inherited from ObjectImpl
| ObjectImpl ()
virtual | ~ObjectImpl ()
void | addRef () const
void | releaseRef () const

## Additional Inherited Members
Static Public Member Functions inherited from Object
static const helpers::Class & | getStaticClass ()
static const log4cxx::helpers::ClassRegistration & | registerClass ()
Protected Attributes inherited from ObjectImpl
unsigned int volatile | ref

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ ~Layout()

virtual ~Layout | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ addRef()

void addRef | ( |  | ) | const
| virtual

Reimplemented from ObjectImpl.

## ◆ appendFooter()

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

Append the footer for the layout format.

The base class does nothing.

Reimplemented in HTMLLayout.

## ◆ appendHeader()

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

Append the header for the layout format.

The base class does nothing.

Reimplemented in HTMLLayout.

## ◆ format()

virtual void 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 XMLLayout, HTMLLayout, JSONLayout, PatternLayout, SimpleLayout, and TTCCLayout.

## ◆ getContentType()

virtual LogString getContentType | ( |  | ) | const
| virtual

Returns the content type output by this layout.

The base class returns "text/plain".

Reimplemented in HTMLLayout, and JSONLayout.

## ◆ ignoresThrowable()

virtual bool 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 HTMLLayout, JSONLayout, PatternLayout, SimpleLayout, TTCCLayout, and XMLLayout.

## ◆ releaseRef()

void releaseRef | ( |  | ) | const
| virtual

Reimplemented from ObjectImpl.

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

- layout.h