Loading...
Searching...
No Matches
SyslogAppender.hh
Go to the documentation of this file.
/*
* SyslogAppender.hh
*
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2000, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4SHIB_SYSLOGAPPENDER_HH
#define _LOG4SHIB_SYSLOGAPPENDER_HH
#include <log4shib/Portability.hh>
#include <string>
#include <stdarg.h>
#include <syslog.h>
#include <log4shib/LayoutAppender.hh>
#include <log4shib/Priority.hh>
namespace log4shib {
class SyslogAppender : public LayoutAppender {
public:
static int toSyslogPriority(Priority::Value priority);
SyslogAppender(const std::string& name, const std::string& syslogName,
int facility = LOG_USER);
virtual ~SyslogAppender();
virtual bool reopen();
virtual void close();
protected:
virtual void open();
virtual void _append(const LoggingEvent& event);
const std::string _syslogName;
int _facility;
};
}
#endif // _LOG4SHIB_SYSLOGAPPENDER_HH
LayoutAppender.hh
Portability.hh
Priority.hh
LOG_USER
@ LOG_USER
random user-level messages
Definition RemoteSyslogAppender.hh:41
log4shib::LayoutAppender::LayoutAppender
LayoutAppender(const std::string &name)
Definition LayoutAppender.cpp:15
log4shib::Priority::Value
int Value
The type of Priority Values.
Definition Priority.hh:84
log4shib::SyslogAppender::~SyslogAppender
virtual ~SyslogAppender()
log4shib::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.
log4shib::SyslogAppender::close
virtual void close()
Calls closelog(3) to close the syslog file descriptor.
log4shib::SyslogAppender::toSyslogPriority
static int toSyslogPriority(Priority::Value priority)
Translates a log4shib priority to a syslog priority.
log4shib::SyslogAppender::_append
virtual void _append(const LoggingEvent &event)
Sends a LoggingEvent to syslog.
log4shib::SyslogAppender::reopen
virtual bool reopen()
Calls closelog(3) and openlog(3).
log4shib::SyslogAppender::_facility
int _facility
Definition SyslogAppender.hh:72
log4shib::SyslogAppender::_syslogName
const std::string _syslogName
Definition SyslogAppender.hh:71
log4shib::SyslogAppender::open
virtual void open()
Calls openlog(3).
log4shib
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
log4shib::LoggingEvent
The internal representation of logging events.
Definition LoggingEvent.hh:32