mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 07:27:23 +01:00
added structure-data doc
This commit is contained in:
parent
69588abd71
commit
41cc2a632e
@ -31,11 +31,18 @@ namespace Net {
|
||||
|
||||
class Net_API RemoteSyslogChannel: public Poco::Channel
|
||||
/// This Channel implements remote syslog logging over UDP according
|
||||
/// to RFC 5424 "The Syslog Protocol"
|
||||
/// to RFC 5424 "The Syslog Protocol"
|
||||
/// and RFC 5426 "Transmission of syslog messages over UDP".
|
||||
///
|
||||
/// In addition, RemoteSyslogListener also supports the "old" BSD syslog
|
||||
/// protocol, as described in RFC 3164.
|
||||
///
|
||||
/// RFC 5425 structured data can be passed via the "structured-data"
|
||||
/// property of the log Message. The content of the "structured-data"
|
||||
/// property must be correct according to RFC 5425.
|
||||
///
|
||||
/// Example:
|
||||
/// msg.set("structured-data", "[exampleSDID@32473 iut=\"3\" eventSource=\"Application\" eventID=\"1011\"]");
|
||||
{
|
||||
public:
|
||||
static const std::string BSD_TIMEFORMAT;
|
||||
@ -52,7 +59,7 @@ public:
|
||||
SYSLOG_INFORMATIONAL = 6, /// Informational: informational messages
|
||||
SYSLOG_DEBUG = 7 /// Debug: debug-level messages
|
||||
};
|
||||
|
||||
|
||||
enum Facility
|
||||
{
|
||||
SYSLOG_KERN = ( 0<<3), /// kernel messages
|
||||
@ -80,28 +87,28 @@ public:
|
||||
SYSLOG_LOCAL6 = (22<<3), /// reserved for local use
|
||||
SYSLOG_LOCAL7 = (23<<3) /// reserved for local use
|
||||
};
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
SYSLOG_PORT = 514
|
||||
};
|
||||
|
||||
|
||||
RemoteSyslogChannel();
|
||||
/// Creates a RemoteSyslogChannel.
|
||||
|
||||
|
||||
RemoteSyslogChannel(const std::string& address, const std::string& name, int facility = SYSLOG_USER, bool bsdFormat = false);
|
||||
/// Creates a RemoteSyslogChannel with the given target address, name, and facility.
|
||||
/// If bsdFormat is true, messages are formatted according to RFC 3164.
|
||||
|
||||
|
||||
void open();
|
||||
/// Opens the RemoteSyslogChannel.
|
||||
|
||||
|
||||
void close();
|
||||
/// Closes the RemoteSyslogChannel.
|
||||
|
||||
|
||||
void log(const Message& msg);
|
||||
/// Sends the message's text to the syslog service.
|
||||
|
||||
|
||||
void setProperty(const std::string& name, const std::string& value);
|
||||
/// Sets the property with the given value.
|
||||
///
|
||||
@ -114,7 +121,7 @@ public:
|
||||
/// by a colon) can also be specified.
|
||||
/// * host: (optional) Host name included in syslog messages. If not specified, the host's real domain name or
|
||||
/// IP address will be used.
|
||||
|
||||
|
||||
std::string getProperty(const std::string& name) const;
|
||||
/// Returns the value of the property with the given name.
|
||||
|
||||
|
@ -35,7 +35,7 @@ class SyslogParser;
|
||||
|
||||
class Net_API RemoteSyslogListener: public Poco::SplitterChannel
|
||||
/// RemoteSyslogListener implements listening for syslog messages
|
||||
/// sent over UDP, according to RFC 5424 "The Syslog Protocol"
|
||||
/// sent over UDP, according to RFC 5424 "The Syslog Protocol"
|
||||
/// and RFC 5426 "Transmission of syslog messages over UDP".
|
||||
///
|
||||
/// In addition, RemoteSyslogListener also supports the "old" BSD syslog
|
||||
@ -50,6 +50,7 @@ class Net_API RemoteSyslogListener: public Poco::SplitterChannel
|
||||
/// - addr: IP address of the host/interface sending the message.
|
||||
/// - host: host name; only for "new" syslog messages.
|
||||
/// - app: application name; only for "new" syslog messages.
|
||||
/// - structured-data: RFC 5424 structured data, or empty if not present.
|
||||
{
|
||||
public:
|
||||
RemoteSyslogListener();
|
||||
@ -72,7 +73,7 @@ public:
|
||||
/// * threads: The number of parser threads processing
|
||||
/// received syslog messages. Defaults to 1. A maximum
|
||||
/// of 16 threads is supported.
|
||||
|
||||
|
||||
std::string getProperty(const std::string& name) const;
|
||||
/// Returns the value of the property with the given name.
|
||||
|
||||
@ -81,7 +82,7 @@ public:
|
||||
|
||||
void close();
|
||||
/// Stops the listener.
|
||||
|
||||
|
||||
void processMessage(const std::string& messageText);
|
||||
/// Parses a single line of text containing a syslog message
|
||||
/// and sends it down the filter chain.
|
||||
|
Loading…
x
Reference in New Issue
Block a user