OFFIS DCMTK  Version 3.6.0
ntelogap.h
Go to the documentation of this file.
1 // Module: Log4CPLUS
2 // File: nteventlogappender.h
3 // Created: 4/2003
4 // Author: Michael CATANZARITI
5 //
6 // Copyright 2003-2009 Michael CATANZARITI
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 
22 #ifndef _LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
23 #define _LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
24 
25 #include "dcmtk/oflog/config.h"
26 #include "dcmtk/oflog/appender.h"
27 
28 #if defined(_WIN32)
29 # if ! defined (LOG4CPLUS_HAVE_NT_EVENT_LOG)
30 # error "Your platform does not support NT event log."
31 # else
32 
33 
34 namespace log4cplus {
35 
39  class LOG4CPLUS_EXPORT NTEventLogAppender : public Appender {
40  public:
41  // ctors
42  NTEventLogAppender(const log4cplus::tstring& server,
43  const log4cplus::tstring& log,
44  const log4cplus::tstring& source);
45  NTEventLogAppender(const log4cplus::helpers::Properties properties, tstring& error);
46 
47  // dtor
48  virtual ~NTEventLogAppender();
49 
50  // public Methods
51  virtual void close();
52 
53  protected:
54  virtual void append(const spi::InternalLoggingEvent& event);
55  virtual WORD getEventType(const spi::InternalLoggingEvent& event);
56  virtual WORD getEventCategory(const spi::InternalLoggingEvent& event);
57  void init();
58 
59  /*
60  * Add this source with appropriate configuration keys to the registry.
61  */
62  void addRegistryInfo();
63 
64  // Data
65  log4cplus::tstring server;
67  log4cplus::tstring source;
68  HANDLE hEventLog;
69  SID* pCurrentUserSID;
70 
71  private:
72  // Disallow copying of instances of this class
73  NTEventLogAppender(const NTEventLogAppender&);
74  NTEventLogAppender& operator=(const NTEventLogAppender&);
75  };
76 
77 } // end namespace log4cplus
78 
79 #endif // LOG4CPLUS_HAVE_NT_EVENT_LOG
80 #endif // _WIN32
81 #endif //_LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2