log4cpp
1.1.6
Toggle main menu visibility
Loading...
Searching...
No Matches
SyslogAppender.hh
Go to the documentation of this file.
1
/*
2
* SyslogAppender.hh
3
*
4
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5
* Copyright 2000, Bastiaan Bakker. All rights reserved.
6
*
7
* See the COPYING file for the terms of usage and distribution.
8
*/
9
10
#ifndef _LOG4CPP_SYSLOGAPPENDER_HH
11
#define _LOG4CPP_SYSLOGAPPENDER_HH
12
13
#include <
log4cpp/LayoutAppender.hh
>
14
#include <
log4cpp/Portability.hh
>
15
#include <
log4cpp/Priority.hh
>
16
#include <stdarg.h>
17
#include <string>
18
#include <syslog.h>
19
20
namespace
log4cpp
{
21
25
class
SyslogAppender
:
public
LayoutAppender
{
26
public
:
32
static
int
toSyslogPriority
(
Priority::Value
priority);
33
43
SyslogAppender
(
const
std::string& name,
const
std::string& syslogName,
int
facility =
LOG_USER
);
44
virtual
~SyslogAppender
();
45
49
virtual
bool
reopen
();
50
54
virtual
void
close
();
55
56
protected
:
60
virtual
void
open
();
61
66
virtual
void
_append
(
const
LoggingEvent
& event);
67
68
const
std::string
_syslogName
;
69
int
_facility
;
70
};
71
}
// namespace log4cpp
72
73
#endif
// _LOG4CPP_SYSLOGAPPENDER_HH
LayoutAppender.hh
Portability.hh
Priority.hh
LOG_USER
@ LOG_USER
random user-level messages
Definition
RemoteSyslogAppender.hh:41
log4cpp::LayoutAppender::LayoutAppender
LayoutAppender(const std::string &name)
Definition
LayoutAppender.cpp:15
log4cpp::Priority::Value
int Value
The type of Priority Values.
Definition
Priority.hh:85
log4cpp::SyslogAppender::_facility
int _facility
Definition
SyslogAppender.hh:69
log4cpp::SyslogAppender::SyslogAppender
SyslogAppender(const std::string &name, const std::string &syslogName, int facility=LOG_USER)
Instantiate a SyslogAppender with given name and name and facility for syslog.
log4cpp::SyslogAppender::_append
virtual void _append(const LoggingEvent &event)
Sends a LoggingEvent to syslog.
log4cpp::SyslogAppender::reopen
virtual bool reopen()
Calls closelog(3) and openlog(3).
log4cpp::SyslogAppender::toSyslogPriority
static int toSyslogPriority(Priority::Value priority)
Translates a log4cpp priority to a syslog priority.
log4cpp::SyslogAppender::close
virtual void close()
Calls closelog(3) to close the syslog file descriptor.
log4cpp::SyslogAppender::_syslogName
const std::string _syslogName
Definition
SyslogAppender.hh:68
log4cpp::SyslogAppender::~SyslogAppender
virtual ~SyslogAppender()
log4cpp::SyslogAppender::open
virtual void open()
Calls openlog(3).
log4cpp
The top level namespace for all 'Log for C++' types and classes.
Definition
AbortAppender.hh:16
log4cpp::LoggingEvent
The internal representation of logging events.
Definition
LoggingEvent.hh:32
include
log4cpp
SyslogAppender.hh
Generated by
1.17.0