Apache log4cxx Version @version@
NTEventLogAppender Class Reference

Appends log events to NT EventLog. More...

#include <nteventlogappender.h>

Inheritance diagram for NTEventLogAppender:
AppenderSkeleton Appender ObjectImpl OptionHandler Object Object

Public Member Functions

 NTEventLogAppender ()
 
 NTEventLogAppender (const LogString &server, const LogString &log, const LogString &source, const LayoutPtr &layout)
 
virtual ~NTEventLogAppender ()
 
virtual void activateOptions (log4cxx::helpers::Pool &p)
 Derived appenders should override this method if option structure requires it. More...
 
virtual void close ()
 Release any resources allocated within the appender such as file handles, network connections, etc. More...
 
virtual void setOption (const LogString &option, const LogString &value)
 Set option to value. More...
 
bool requiresLayout () const
 The SocketAppender does not use a layout. More...
 
void setSource (const LogString &source)
 
const LogStringgetSource () const
 
void setLog (const LogString &log)
 
const LogStringgetLog () const
 
void setServer (const LogString &server)
 
const LogStringgetServer () const
 
- Public Member Functions inherited from AppenderSkeleton
 AppenderSkeleton ()
 
 AppenderSkeleton (const LayoutPtr &layout)
 
void addRef () const
 
void releaseRef () const
 
void finalize ()
 Finalize this appender by calling the derived class' close method. More...
 
virtual void activateOptions (log4cxx::helpers::Pool &)
 Derived appenders should override this method if option structure requires it. More...
 
virtual void setOption (const LogString &option, const LogString &value)
 Set option to value. More...
 
void addFilter (const spi::FilterPtr &newFilter)
 Add a filter to end of the filter list. More...
 
void clearFilters ()
 Clear the filters chain. More...
 
const spi::ErrorHandlerPtrgetErrorHandler () const
 Return the currently set spi::ErrorHandler for this Appender. More...
 
spi::FilterPtr getFilter () const
 Returns the head Filter. More...
 
const spi::FilterPtrgetFirstFilter () const
 Return the first filter in the filter chain for this Appender. More...
 
LayoutPtr getLayout () const
 Returns the layout of this appender. More...
 
LogString getName () const
 Returns the name of this Appender. More...
 
const LevelPtrgetThreshold () const
 Returns this appenders threshold level. More...
 
bool isAsSevereAsThreshold (const LevelPtr &level) const
 Check whether the message level is below the appender's threshold. More...
 
virtual void doAppend (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool)
 This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton::append method. More...
 
void setErrorHandler (const spi::ErrorHandlerPtr &eh)
 Set the ErrorHandler for this Appender. More...
 
void setLayout (const LayoutPtr &layout1)
 Set the layout for this appender. More...
 
void setName (const LogString &name1)
 Set the name of this Appender. More...
 
void setThreshold (const LevelPtr &threshold)
 Set the threshold level. More...
 
- Public Member Functions inherited from Appender
virtual ~Appender ()
 
virtual void addFilter (const spi::FilterPtr &newFilter)=0
 Add a filter to the end of the filter list. More...
 
virtual spi::FilterPtr getFilter () const =0
 Returns the head Filter. More...
 
virtual void clearFilters ()=0
 Clear the list of filters by removing all the filters in it. More...
 
virtual void close ()=0
 Release any resources allocated within the appender such as file handles, network connections, etc. More...
 
virtual void doAppend (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool)=0
 Log in Appender specific way. More...
 
virtual LogString getName () const =0
 Get the name of this appender. More...
 
virtual void setLayout (const LayoutPtr &layout)=0
 Set the Layout for this appender. More...
 
virtual LayoutPtr getLayout () const =0
 Returns this appenders layout. More...
 
virtual void setName (const LogString &name)=0
 Set the name of this appender. More...
 
virtual bool requiresLayout () const =0
 Configurators call this method to determine if the appender requires a layout. 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::ClassgetClass () 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
 

Protected Types

typedef void SID
 
typedef void * HANDLE
 

Protected Member Functions

virtual void append (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p)
 Subclasses of AppenderSkeleton should implement this method to perform actual logging. More...
 
void addRegistryInfo ()
 
- Protected Member Functions inherited from AppenderSkeleton
virtual void append (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p)=0
 Subclasses of AppenderSkeleton should implement this method to perform actual logging. More...
 
void doAppendImpl (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool)
 

Static Protected Member Functions

static unsigned short getEventType (const spi::LoggingEventPtr &event)
 
static unsigned short getEventCategory (const spi::LoggingEventPtr &event)
 
static LogString getErrorString (const LogString &function)
 

Protected Attributes

LogString server
 
LogString log
 
LogString source
 
HANDLE hEventLog
 
SIDpCurrentUserSID
 
- Protected Attributes inherited from AppenderSkeleton
LayoutPtr layout
 The layout variable does not need to be set if the appender implementation has its own layout. More...
 
LogString name
 Appenders are named. More...
 
LevelPtr threshold
 There is no level threshold filtering by default. More...
 
spi::ErrorHandlerPtr errorHandler
 It is assumed and enforced that errorHandler is never null. More...
 
spi::FilterPtr headFilter
 The first filter in the filter chain. More...
 
spi::FilterPtr tailFilter
 The last filter in the filter chain. More...
 
bool closed
 Is this appender closed? More...
 
log4cxx::helpers::Pool pool
 
SHARED_MUTEX mutex
 
- 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

Appends log events to NT EventLog.

Member Typedef Documentation

◆ HANDLE

typedef void* HANDLE
protected

◆ SID

typedef void SID
protected

Constructor & Destructor Documentation

◆ NTEventLogAppender() [1/2]

◆ NTEventLogAppender() [2/2]

NTEventLogAppender ( const LogString server,
const LogString log,
const LogString source,
const LayoutPtr layout 
)

◆ ~NTEventLogAppender()

virtual ~NTEventLogAppender ( )
virtual

Member Function Documentation

◆ activateOptions()

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

Derived appenders should override this method if option structure requires it.

Reimplemented from AppenderSkeleton.

◆ addRegistryInfo()

void addRegistryInfo ( )
protected

◆ append()

virtual void append ( const spi::LoggingEventPtr event,
log4cxx::helpers::Pool p 
)
protectedvirtual

Subclasses of AppenderSkeleton should implement this method to perform actual logging.

See also AppenderSkeleton::doAppend method.

Implements AppenderSkeleton.

◆ close()

virtual void close ( )
virtual

Release any resources allocated within the appender such as file handles, network connections, etc.

It is a programming error to append to a closed appender.

Implements Appender.

◆ getErrorString()

static LogString getErrorString ( const LogString function)
staticprotected

◆ getEventCategory()

static unsigned short getEventCategory ( const spi::LoggingEventPtr event)
staticprotected

◆ getEventType()

static unsigned short getEventType ( const spi::LoggingEventPtr event)
staticprotected

◆ getLog()

const LogString & getLog ( ) const
inline

◆ getServer()

const LogString & getServer ( ) const
inline

◆ getSource()

const LogString & getSource ( ) const
inline

◆ requiresLayout()

bool requiresLayout ( ) const
inlinevirtual

The SocketAppender does not use a layout.

Hence, this method returns false.

Implements Appender.

◆ setLog()

void setLog ( const LogString log)
inline

◆ setOption()

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.

Reimplemented from AppenderSkeleton.

◆ setServer()

void setServer ( const LogString server)
inline

◆ setSource()

void setSource ( const LogString source)
inline

Member Data Documentation

◆ hEventLog

HANDLE hEventLog
protected

◆ log

LogString log
protected

◆ pCurrentUserSID

SID* pCurrentUserSID
protected

◆ server

LogString server
protected

◆ source

LogString source
protected

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