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>
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,
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),
63 #endif
64 
66 
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;
128 #ifdef WIN32
129  SOCKET _socket;
130 #else
131  int _socket;
132 #endif
134 private:
135  int _cludge;
136 };
138 
139 #endif // _LOG4CPP_REMOTESYSLOGAPPENDER_HH
security/authorization messages (private)
reserved for local use
system is unusable
error conditions
#define LOG4CPP_NS_END
Definition: Portability.hh:50
informational
line printer subsystem
SyslogLevel
from syslog.h
reserved for local use
debug-level messages
warning conditions
normal but significant condition
virtual bool reopen()
Reopens the output destination of this Appender, e.g.
The top level namespace for all &#39;Log for C++&#39; types and classes.
Definition: LoggingEvent.hh:32
network news subsystem
critical conditions
virtual void _append(const LoggingEvent &event)=0
Log in Appender specific way.
reserved for local use
const std::string _syslogName
messages generated internally by syslogd
action must be taken immediately
LayoutAppender is a common superclass for all Appenders that require a Layout.
system daemons
clock daemon
reserved for local use
virtual void close()=0
Release any resources allocated within the appender such as file handles, network connections...
security/authorization messages
#define LOG4CPP_EXPORT
Definition: Export.hh:21
kernel messages
u_long in_addr_t
Definition: config-win32.h:32
const std::string _relayer
mail system
RemoteSyslogAppender sends LoggingEvents to a remote syslog system.
UUCP subsystem.
ftp daemon
reserved for local use
reserved for local use
int Value
The type of Priority Values.
Definition: Priority.hh:87
reserved for local use
random user-level messages
reserved for local use
#define LOG4CPP_NS_BEGIN
Definition: Portability.hh:49


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:41