Apache log4cxx  Version 0.11.0
DateLayout Class Reference

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

Inheritance diagram for DateLayout:
Layout OptionHandler ObjectImpl Object Object 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 Layout
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 ()
 
- Public Member Functions inherited from Object
virtual const helpers::ClassgetClass () const
 
virtual ~Object ()
 
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 ()
 

Protected Attributes

DateFormatPtr dateFormat
 
- Protected Attributes inherited from ObjectImpl
unsigned int volatile ref
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static const helpers::ClassgetStaticClass ()
 
static const log4cxx::helpers::ClassRegistrationregisterClass ()
 

Detailed Description

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

Constructor & Destructor Documentation

DateLayout ( const LogString dateLayoutOption)
virtual ~DateLayout ( )
virtual

Member Function Documentation

virtual void 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 OptionHandler.

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

Returns value of the DateFormat option.

const LogString& getTimeZone ( ) const
inline

Returns value of the TimeZone option.

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

virtual void 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 OptionHandler.

void 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

DateFormatPtr dateFormat
protected

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