Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
log4cpp
RemoteSyslogAppender.hh
Go to the documentation of this file.
1
/*
2
* SyslogAppender.hh
3
*
4
* Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5
* Copyright 2001, Walter Stroebel. All rights reserved.
6
*
7
* See the COPYING file for the terms of usage and distribution.
8
*/
9
10
#ifndef _LOG4CPP_REMOTESYSLOGAPPENDER_HH
11
#define _LOG4CPP_REMOTESYSLOGAPPENDER_HH
12
13
#include <
log4cpp/Portability.hh
>
14
#include <string>
15
#include <stdarg.h>
16
#include <
log4cpp/LayoutAppender.hh
>
17
#include <
log4cpp/Priority.hh
>
18
#ifdef WIN32
19
#include <winsock2.h>
20
#else
21
#include <netinet/in.h>
22
#endif
23
24
#ifdef LOG4CPP_HAVE_SYSLOG
25
#include <syslog.h>
26
#else
27
typedef
enum
{
29
LOG_EMERG
= 0,
30
LOG_ALERT
= 1,
31
LOG_CRIT
= 2,
32
LOG_ERR
= 3,
33
LOG_WARNING
= 4,
34
LOG_NOTICE
= 5,
35
LOG_INFO
= 6,
36
LOG_DEBUG
= 7,
37
}
SyslogLevel
;
38
39
typedef
enum
{
40
LOG_KERN
= (0<<3),
41
LOG_USER
= (1<<3),
42
LOG_MAIL
= (2<<3),
43
LOG_DAEMON
= (3<<3),
44
LOG_AUTH
= (4<<3),
45
LOG_SYSLOG
= (5<<3),
46
LOG_LPR
= (6<<3),
47
LOG_NEWS
= (7<<3),
48
LOG_UUCP
= (8<<3),
49
LOG_CRON
= (9<<3),
50
LOG_AUTHPRIV
= (10<<3),
51
LOG_FTP
= (11<<3),
52
53
/* other codes through 15 reserved for system use */
54
LOG_LOCAL0
= (16<<3),
55
LOG_LOCAL1
= (17<<3),
56
LOG_LOCAL2
= (18<<3),
57
LOG_LOCAL3
= (19<<3),
58
LOG_LOCAL4
= (20<<3),
59
LOG_LOCAL5
= (21<<3),
60
LOG_LOCAL6
= (22<<3),
61
LOG_LOCAL7
= (23<<3),
62
}
SyslogFacility
;
63
#endif
64
65
namespace
log4cpp
{
66
72
class
LOG4CPP_EXPORT
RemoteSyslogAppender
:
public
LayoutAppender
{
73
public
:
74
80
static
int
toSyslogPriority(
Priority::Value
priority);
81
94
RemoteSyslogAppender
(
const
std::string& name,
95
const
std::string& syslogName,
96
const
std::string& relayer,
97
int
facility =
LOG_USER
,
98
int
portNumber = 514);
99
virtual
~
RemoteSyslogAppender
();
100
104
virtual
bool
reopen();
105
109
virtual
void
close();
110
111
protected
:
112
116
virtual
void
open();
117
122
virtual
void
_append(
const
LoggingEvent
& event);
123
124
const
std::string
_syslogName
;
125
const
std::string
_relayer
;
126
int
_facility
;
127
int
_portNumber
;
128
#ifdef WIN32
129
SOCKET _socket;
130
#else
131
int
_socket
;
132
#endif
133
in_addr_t
_ipAddr
;
134
private
:
135
int
_cludge
;
136
};
137
}
138
139
#endif // _LOG4CPP_REMOTESYSLOGAPPENDER_HH
SyslogFacility
SyslogFacility
Definition:
RemoteSyslogAppender.hh:39
LOG_AUTHPRIV
security/authorization messages (private)
Definition:
RemoteSyslogAppender.hh:50
LOG_LOCAL4
reserved for local use
Definition:
RemoteSyslogAppender.hh:58
LOG_EMERG
system is unusable
Definition:
RemoteSyslogAppender.hh:29
LOG_ERR
error conditions
Definition:
RemoteSyslogAppender.hh:32
LOG_INFO
informational
Definition:
RemoteSyslogAppender.hh:35
LOG_LPR
line printer subsystem
Definition:
RemoteSyslogAppender.hh:46
SyslogLevel
SyslogLevel
from syslog.h
Definition:
RemoteSyslogAppender.hh:28
LOG_LOCAL1
reserved for local use
Definition:
RemoteSyslogAppender.hh:55
LOG_DEBUG
debug-level messages
Definition:
RemoteSyslogAppender.hh:36
in_addr_t
u_long in_addr_t
Definition:
config-MinGW32.h:38
log4cpp::RemoteSyslogAppender::_relayer
const std::string _relayer
Definition:
RemoteSyslogAppender.hh:125
LOG_WARNING
warning conditions
Definition:
RemoteSyslogAppender.hh:33
LOG_NOTICE
normal but significant condition
Definition:
RemoteSyslogAppender.hh:34
LOG_NEWS
network news subsystem
Definition:
RemoteSyslogAppender.hh:47
LOG_CRIT
critical conditions
Definition:
RemoteSyslogAppender.hh:31
LOG_LOCAL2
reserved for local use
Definition:
RemoteSyslogAppender.hh:56
Portability.hh
LOG_SYSLOG
messages generated internally by syslogd
Definition:
RemoteSyslogAppender.hh:45
LOG_ALERT
action must be taken immediately
Definition:
RemoteSyslogAppender.hh:30
log4cpp::RemoteSyslogAppender::_ipAddr
in_addr_t _ipAddr
Definition:
RemoteSyslogAppender.hh:133
LOG_DAEMON
system daemons
Definition:
RemoteSyslogAppender.hh:43
LOG_CRON
clock daemon
Definition:
RemoteSyslogAppender.hh:49
log4cpp::RemoteSyslogAppender::_portNumber
int _portNumber
Definition:
RemoteSyslogAppender.hh:127
log4cpp::RemoteSyslogAppender::_cludge
int _cludge
Definition:
RemoteSyslogAppender.hh:135
LOG_LOCAL7
reserved for local use
Definition:
RemoteSyslogAppender.hh:61
LOG_AUTH
security/authorization messages
Definition:
RemoteSyslogAppender.hh:44
LOG4CPP_EXPORT
#define LOG4CPP_EXPORT
Definition:
Export.hh:26
LOG_KERN
kernel messages
Definition:
RemoteSyslogAppender.hh:40
log4cpp
Definition:
AbortAppender.hh:16
log4cpp::LoggingEvent
Definition:
LoggingEvent.hh:32
log4cpp::Priority::Value
int Value
Definition:
Priority.hh:85
log4cpp::RemoteSyslogAppender::_syslogName
const std::string _syslogName
Definition:
RemoteSyslogAppender.hh:124
LOG_MAIL
mail system
Definition:
RemoteSyslogAppender.hh:42
log4cpp::RemoteSyslogAppender::_socket
int _socket
Definition:
RemoteSyslogAppender.hh:131
LOG_UUCP
UUCP subsystem.
Definition:
RemoteSyslogAppender.hh:48
log4cpp::RemoteSyslogAppender
Definition:
RemoteSyslogAppender.hh:72
LOG_FTP
ftp daemon
Definition:
RemoteSyslogAppender.hh:51
LOG_LOCAL0
reserved for local use
Definition:
RemoteSyslogAppender.hh:54
log4cpp::RemoteSyslogAppender::_facility
int _facility
Definition:
RemoteSyslogAppender.hh:126
log4cpp::LayoutAppender
Definition:
LayoutAppender.hh:24
LOG_LOCAL5
reserved for local use
Definition:
RemoteSyslogAppender.hh:59
LOG_LOCAL3
reserved for local use
Definition:
RemoteSyslogAppender.hh:57
Priority.hh
LOG_USER
random user-level messages
Definition:
RemoteSyslogAppender.hh:41
LOG_LOCAL6
reserved for local use
Definition:
RemoteSyslogAppender.hh:60
LayoutAppender.hh
log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:10:00