00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00015 #ifndef _LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
00016 #define _LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
00017
00018 #include <log4cplus/config.h>
00019 #if defined(_WIN32)
00020
00021 #include <log4cplus/appender.h>
00022
00023
00024 namespace log4cplus {
00025
00029 class LOG4CPLUS_EXPORT NTEventLogAppender : public Appender {
00030 public:
00031
00032 NTEventLogAppender(const log4cplus::tstring& server,
00033 const log4cplus::tstring& log,
00034 const log4cplus::tstring& source);
00035 NTEventLogAppender(const log4cplus::helpers::Properties properties);
00036
00037
00038 virtual ~NTEventLogAppender();
00039
00040
00041 virtual void close();
00042
00043 protected:
00044 virtual void append(const spi::InternalLoggingEvent& event);
00045 virtual WORD getEventType(const spi::InternalLoggingEvent& event);
00046 virtual WORD getEventCategory(const spi::InternalLoggingEvent& event);
00047 void init();
00048
00049
00050
00051
00052 void addRegistryInfo();
00053
00054
00055 log4cplus::tstring server;
00056 log4cplus::tstring log;
00057 log4cplus::tstring source;
00058 HANDLE hEventLog;
00059 SID* pCurrentUserSID;
00060
00061 private:
00062
00063 NTEventLogAppender(const NTEventLogAppender&);
00064 NTEventLogAppender& operator=(const NTEventLogAppender&);
00065 };
00066
00067 }
00068
00069 #endif // _WIN32
00070 #endif //_LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
00071