#include <NTEventLogAppender.hh>
Inheritance diagram for log4cpp::NTEventLogAppender:
Public Member Functions | |
NTEventLogAppender (const std::string &name, const std::string &sourceName) | |
Instantiate an NTEventLogAppender with given name and source. | |
virtual | ~NTEventLogAppender () |
virtual bool | reopen () |
Calls open() and close(). | |
virtual void | close () |
Release any resources allocated within the appender such as file handles, network connections, etc. | |
virtual bool | requiresLayout () const |
The NTEventLogAppender does its own Layout. | |
virtual void | setLayout (Layout *layout) |
Set the Layout for this appender. | |
Protected Member Functions | |
WORD | getCategory (Priority::Value priority) |
Convert log4cpp Priority to an EventLog category. | |
WORD | getType (Priority::Value priority) |
Convert log4cpp Priority to an EventLog type. | |
HKEY | regGetKey (TCHAR *subkey, DWORD *disposition) |
void | regSetString (HKEY hkey, TCHAR *name, TCHAR *value) |
void | regSetDword (HKEY hkey, TCHAR *name, DWORD value) |
void | addRegistryInfo (const char *source) |
virtual void | open () |
virtual void | _append (const LoggingEvent &event) |
Sends a LoggingEvent to NT Event log. | |
Protected Attributes | |
HANDLE | _hEventSource |
std::string | _strSourceName |
Building log4cpp.dsp/log4cppDLL.dsp creates the resource DLL NTEventLogAppender.dll. Do not forget to place this DLL in a directory that is on the PATH of the Windows system. Otherwise, the category and message will not display correctly in Event Viewer.
NB: This class is only available on Win32 platforms.
log4cpp::NTEventLogAppender::NTEventLogAppender | ( | const std::string & | name, | |
const std::string & | sourceName | |||
) |
Instantiate an NTEventLogAppender with given name and source.
name | The name of the Appender | |
sourceName | The source name to log |
log4cpp::NTEventLogAppender::~NTEventLogAppender | ( | ) | [virtual] |
bool log4cpp::NTEventLogAppender::reopen | ( | ) | [virtual] |
void log4cpp::NTEventLogAppender::close | ( | ) | [virtual] |
Release any resources allocated within the appender such as file handles, network connections, etc.
Implements log4cpp::AppenderSkeleton.
bool log4cpp::NTEventLogAppender::requiresLayout | ( | ) | const [virtual] |
void log4cpp::NTEventLogAppender::setLayout | ( | Layout * | layout | ) | [virtual] |
Set the Layout for this appender.
layout | The layout to use. |
Implements log4cpp::AppenderSkeleton.
WORD log4cpp::NTEventLogAppender::getCategory | ( | Priority::Value | priority | ) | [protected] |
WORD log4cpp::NTEventLogAppender::getType | ( | Priority::Value | priority | ) | [protected] |
HKEY log4cpp::NTEventLogAppender::regGetKey | ( | TCHAR * | subkey, | |
DWORD * | disposition | |||
) | [protected] |
void log4cpp::NTEventLogAppender::regSetString | ( | HKEY | hkey, | |
TCHAR * | name, | |||
TCHAR * | value | |||
) | [protected] |
void log4cpp::NTEventLogAppender::regSetDword | ( | HKEY | hkey, | |
TCHAR * | name, | |||
DWORD | value | |||
) | [protected] |
void log4cpp::NTEventLogAppender::addRegistryInfo | ( | const char * | source | ) | [protected] |
void log4cpp::NTEventLogAppender::open | ( | ) | [protected, virtual] |
void log4cpp::NTEventLogAppender::_append | ( | const LoggingEvent & | event | ) | [protected, virtual] |
Sends a LoggingEvent to NT Event log.
event | the LoggingEvent to log. |
Implements log4cpp::AppenderSkeleton.
HANDLE log4cpp::NTEventLogAppender::_hEventSource [protected] |
std::string log4cpp::NTEventLogAppender::_strSourceName [protected] |