oflog/include/dcmtk/oflog/ntelogap.h

Go to the documentation of this file.
00001 // Module:  Log4CPLUS
00002 // File:    nteventlogappender.h
00003 // Created: 4/2003
00004 // Author:  Michael CATANZARITI
00005 //
00006 // Copyright 2003-2009 Michael CATANZARITI
00007 //
00008 // Licensed under the Apache License, Version 2.0 (the "License");
00009 // you may not use this file except in compliance with the License.
00010 // You may obtain a copy of the License at
00011 //
00012 //     http://www.apache.org/licenses/LICENSE-2.0
00013 //
00014 // Unless required by applicable law or agreed to in writing, software
00015 // distributed under the License is distributed on an "AS IS" BASIS,
00016 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017 // See the License for the specific language governing permissions and
00018 // limitations under the License.
00019 
00022 #ifndef _LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
00023 #define _LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
00024 
00025 #include "dcmtk/oflog/config.h"
00026 #include "dcmtk/oflog/appender.h"
00027 
00028 #if defined(_WIN32)
00029 #  if ! defined (LOG4CPLUS_HAVE_NT_EVENT_LOG)
00030 #    error "Your platform does not support NT event log."
00031 #  else
00032 
00033 
00034 namespace log4cplus {
00035 
00039     class LOG4CPLUS_EXPORT NTEventLogAppender : public Appender {
00040     public:
00041       // ctors
00042         NTEventLogAppender(const log4cplus::tstring& server,
00043                            const log4cplus::tstring& log,
00044                            const log4cplus::tstring& source);
00045         NTEventLogAppender(const log4cplus::helpers::Properties properties, tstring& error);
00046 
00047       // dtor
00048         virtual ~NTEventLogAppender();
00049 
00050       // public Methods
00051         virtual void close();
00052 
00053     protected:
00054         virtual void append(const spi::InternalLoggingEvent& event);
00055         virtual WORD getEventType(const spi::InternalLoggingEvent& event);
00056         virtual WORD getEventCategory(const spi::InternalLoggingEvent& event);
00057         void init();
00058 
00059         /*
00060          * Add this source with appropriate configuration keys to the registry.
00061          */
00062         void addRegistryInfo();
00063 
00064       // Data
00065         log4cplus::tstring server;
00066         log4cplus::tstring log;
00067         log4cplus::tstring source;
00068         HANDLE hEventLog;
00069         SID* pCurrentUserSID;
00070 
00071     private:
00072       // Disallow copying of instances of this class
00073         NTEventLogAppender(const NTEventLogAppender&);
00074         NTEventLogAppender& operator=(const NTEventLogAppender&);
00075     };
00076 
00077 } // end namespace log4cplus
00078 
00079 #endif // LOG4CPLUS_HAVE_NT_EVENT_LOG
00080 #endif // _WIN32
00081 #endif //_LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1