Apache log4cxx  Version 0.12.0
log4cxx::helpers::DateLayout Class Reference

This abstract layout takes care of all the date related options and formatting work. More...

#include <datelayout.h>

Inheritance diagram for log4cxx::helpers::DateLayout:
log4cxx::Layout log4cxx::spi::OptionHandler log4cxx::helpers::Object log4cxx::helpers::Object log4cxx::TTCCLayout

Public Member Functions

 DateLayout (const LogString &dateLayoutOption)
 
virtual ~DateLayout ()
 
virtual void activateOptions (log4cxx::helpers::Pool &p)
 Activate the options that were previously set with calls to option setters. More...
 
virtual void setOption (const LogString &option, const LogString &value)
 Set option to value. More...
 
void setDateFormat (const LogString &dateFormat1)
 The value of the DateFormat option should be either an argument to the constructor of helpers::DateFormat or one of the strings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601. More...
 
const LogStringgetDateFormat () const
 Returns value of the DateFormat option. More...
 
void setTimeZone (const LogString &timeZone)
 The TimeZoneID option is a time zone ID string in the format expected by the locale C++ standard class. More...
 
const LogStringgetTimeZone () const
 Returns value of the TimeZone option. More...
 
void formatDate (LogString &s, const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p) const
 
- Public Member Functions inherited from log4cxx::Layout
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 ()
 
- 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
 

Protected Attributes

DateFormatPtr dateFormat
 

Detailed Description

This abstract layout takes care of all the date related options and formatting work.

Constructor & Destructor Documentation

◆ DateLayout()

log4cxx::helpers::DateLayout::DateLayout ( const LogString dateLayoutOption)

◆ ~DateLayout()

virtual log4cxx::helpers::DateLayout::~DateLayout ( )
virtual

Member Function Documentation

◆ activateOptions()

virtual void log4cxx::helpers::DateLayout::activateOptions ( log4cxx::helpers::Pool p)
virtual

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

This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.

For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.

Implements log4cxx::spi::OptionHandler.

◆ formatDate()

void log4cxx::helpers::DateLayout::formatDate ( LogString s,
const spi::LoggingEventPtr event,
log4cxx::helpers::Pool p 
) const

◆ getDateFormat()

const LogString& log4cxx::helpers::DateLayout::getDateFormat ( ) const
inline

Returns value of the DateFormat option.

◆ getTimeZone()

const LogString& log4cxx::helpers::DateLayout::getTimeZone ( ) const
inline

Returns value of the TimeZone option.

◆ setDateFormat()

void log4cxx::helpers::DateLayout::setDateFormat ( const LogString dateFormat1)
inline

The value of the DateFormat option should be either an argument to the constructor of helpers::DateFormat or one of the strings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.

◆ setOption()

virtual void log4cxx::helpers::DateLayout::setOption ( const LogString option,
const LogString value 
)
virtual

Set option to value.

The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when activateOptions is called.

Implements log4cxx::spi::OptionHandler.

◆ setTimeZone()

void log4cxx::helpers::DateLayout::setTimeZone ( const LogString timeZone)
inline

The TimeZoneID option is a time zone ID string in the format expected by the locale C++ standard class.

Member Data Documentation

◆ dateFormat

DateFormatPtr log4cxx::helpers::DateLayout::dateFormat
protected

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