This Unix-only channel works with the Unix syslog service. More...
#include <SyslogChannel.h>
Public Types | |
enum | Facility { SYSLOG_KERN = ( 0<<3), SYSLOG_USER = ( 1<<3), SYSLOG_MAIL = ( 2<<3), SYSLOG_DAEMON = ( 3<<3), SYSLOG_AUTH = ( 4<<3), SYSLOG_SYSLOG = ( 5<<3), SYSLOG_LPR = ( 6<<3), SYSLOG_NEWS = ( 7<<3), SYSLOG_UUCP = ( 8<<3), SYSLOG_CRON = ( 9<<3), SYSLOG_AUTHPRIV = (10<<3), SYSLOG_FTP = (11<<3), SYSLOG_LOCAL0 = (16<<3), SYSLOG_LOCAL1 = (17<<3), SYSLOG_LOCAL2 = (18<<3), SYSLOG_LOCAL3 = (19<<3), SYSLOG_LOCAL4 = (20<<3), SYSLOG_LOCAL5 = (21<<3), SYSLOG_LOCAL6 = (22<<3), SYSLOG_LOCAL7 = (23<<3) } |
enum | Option { SYSLOG_PID = 0x01, SYSLOG_CONS = 0x02, SYSLOG_NDELAY = 0x08, SYSLOG_PERROR = 0x20 } |
Public Member Functions | |
void | close () |
Opens the SyslogChannel. | |
std::string | getProperty (const std::string &name) const |
void | log (const Message &msg) |
Closes the SyslogChannel. | |
void | open () |
Creates a SyslogChannel with the given name, options and facility. | |
void | setProperty (const std::string &name, const std::string &value) |
Sens the message's text to the syslog service. | |
SyslogChannel () | |
SyslogChannel (const std::string &name, int options=SYSLOG_CONS, int facility=SYSLOG_USER) | |
Creates a SyslogChannel. | |
Static Public Attributes | |
static const std::string | PROP_FACILITY |
static const std::string | PROP_NAME |
Returns the value of the property with the given name. | |
static const std::string | PROP_OPTIONS |
Protected Member Functions | |
~SyslogChannel () | |
Static Protected Member Functions | |
static int | getPrio (const Message &msg) |
Private Attributes | |
int | _facility |
std::string | _name |
bool | _open |
int | _options |
This Unix-only channel works with the Unix syslog service.
Definition at line 50 of file SyslogChannel.h.
Definition at line 62 of file SyslogChannel.h.
SYSLOG_PID | |
SYSLOG_CONS |
log the pid with each message |
SYSLOG_NDELAY |
log on the console if errors in sending |
SYSLOG_PERROR |
don't delay open |
Definition at line 54 of file SyslogChannel.h.
Poco::SyslogChannel::SyslogChannel | ( | const std::string & | name, |
int | options = SYSLOG_CONS , |
||
int | facility = SYSLOG_USER |
||
) |
Creates a SyslogChannel.
Poco::SyslogChannel::~SyslogChannel | ( | ) | [protected] |
void Poco::SyslogChannel::close | ( | ) |
Opens the SyslogChannel.
static int Poco::SyslogChannel::getPrio | ( | const Message & | msg | ) | [static, protected] |
std::string Poco::SyslogChannel::getProperty | ( | const std::string & | name | ) | const |
Sets the property with the given value.
The following properties are supported: name: The name used to identify the source of log messages. facility: The facility added to each log message. See the Facility enumeration for a list of supported values. options: The logging options. See the Option enumeration for a list of supported values.
void Poco::SyslogChannel::log | ( | const Message & | msg | ) |
Closes the SyslogChannel.
void Poco::SyslogChannel::open | ( | ) |
Creates a SyslogChannel with the given name, options and facility.
void Poco::SyslogChannel::setProperty | ( | const std::string & | name, |
const std::string & | value | ||
) |
Sens the message's text to the syslog service.
int Poco::SyslogChannel::_facility [private] |
Definition at line 123 of file SyslogChannel.h.
std::string Poco::SyslogChannel::_name [private] |
Definition at line 121 of file SyslogChannel.h.
bool Poco::SyslogChannel::_open [private] |
Definition at line 124 of file SyslogChannel.h.
int Poco::SyslogChannel::_options [private] |
Definition at line 122 of file SyslogChannel.h.
const std::string Poco::SyslogChannel::PROP_FACILITY [static] |
Definition at line 113 of file SyslogChannel.h.
const std::string Poco::SyslogChannel::PROP_NAME [static] |
Returns the value of the property with the given name.
Definition at line 112 of file SyslogChannel.h.
const std::string Poco::SyslogChannel::PROP_OPTIONS [static] |
Definition at line 114 of file SyslogChannel.h.