log4cplus
2.0.6
include
log4cplus
nteventlogappender.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
// Module: Log4CPLUS
3
// File: nteventlogappender.h
4
// Created: 4/2003
5
// Author: Michael CATANZARITI
6
//
7
// Copyright 2003-2017 Michael CATANZARITI
8
//
9
// Licensed under the Apache License, Version 2.0 (the "License");
10
// you may not use this file except in compliance with the License.
11
// You may obtain a copy of the License at
12
//
13
// http://www.apache.org/licenses/LICENSE-2.0
14
//
15
// Unless required by applicable law or agreed to in writing, software
16
// distributed under the License is distributed on an "AS IS" BASIS,
17
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
// See the License for the specific language governing permissions and
19
// limitations under the License.
20
23
#ifndef LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
24
#define LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
25
26
#include <
log4cplus/config.hxx
>
27
28
#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
29
#pragma once
30
#endif
31
32
#if defined (LOG4CPLUS_HAVE_NT_EVENT_LOG)
33
34
#include <
log4cplus/appender.h
>
35
#include <
log4cplus/config/windowsh-inc.h
>
36
37
38
namespace
log4cplus
{
39
43
class
LOG4CPLUS_EXPORT
NTEventLogAppender
:
public
Appender
{
44
public
:
45
// ctors
46
NTEventLogAppender
(
const
log4cplus::tstring
& server,
47
const
log4cplus::tstring
& log,
48
const
log4cplus::tstring
& source);
49
NTEventLogAppender
(
const
log4cplus::helpers::Properties
& properties);
50
51
// dtor
52
virtual
~
NTEventLogAppender
();
53
54
// public Methods
55
virtual
void
close();
56
57
protected
:
58
virtual
void
append(
const
spi::InternalLoggingEvent
& event);
59
virtual
WORD getEventType(
const
spi::InternalLoggingEvent
& event);
60
virtual
WORD getEventCategory(
const
spi::InternalLoggingEvent
& event);
61
void
init();
62
63
/*
64
* Add this source with appropriate configuration keys to the registry.
65
*/
66
void
addRegistryInfo();
67
68
// Data
69
log4cplus::tstring
server
;
70
log4cplus::tstring
log
;
71
log4cplus::tstring
source
;
72
HANDLE
hEventLog
;
73
SID*
pCurrentUserSID
;
74
75
private
:
76
// Disallow copying of instances of this class
77
NTEventLogAppender
(
const
NTEventLogAppender
&);
78
NTEventLogAppender
& operator=(
const
NTEventLogAppender
&);
79
};
80
81
}
// end namespace log4cplus
82
83
#endif // LOG4CPLUS_HAVE_NT_EVENT_LOG
84
#endif //LOG4CPLUS_NT_EVENT_LOG_APPENDER_HEADER_
windowsh-inc.h
log4cplus
Definition:
appender.h:46
log4cplus::NTEventLogAppender::server
log4cplus::tstring server
Definition:
nteventlogappender.h:69
log4cplus::tstring
std::basic_string< tchar > tstring
Definition:
tstring.h:39
log4cplus::NTEventLogAppender::hEventLog
HANDLE hEventLog
Definition:
nteventlogappender.h:72
log4cplus::NTEventLogAppender::log
log4cplus::tstring log
Definition:
nteventlogappender.h:70
log4cplus::NTEventLogAppender::pCurrentUserSID
SID * pCurrentUserSID
Definition:
nteventlogappender.h:73
config.hxx
log4cplus::helpers::Properties
Definition:
property.h:43
log4cplus::NTEventLogAppender
Appends log events to NT EventLog.
Definition:
nteventlogappender.h:43
log4cplus::spi::InternalLoggingEvent
The internal representation of logging events.
Definition:
loggingevent.h:51
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition:
win32.h:141
log4cplus::NTEventLogAppender::source
log4cplus::tstring source
Definition:
nteventlogappender.h:71
appender.h
log4cplus::Appender
Extend this class for implementing your own strategies for printing log statements.
Definition:
appender.h:137
Generated on Fri Jun 18 2021 08:46:20 for log4cplus by
1.8.17