1#ifndef __NETWORKTARGET_HPP
2#define __NETWORKTARGET_HPP
4#include <stumpless/target.h>
7#include <stumpless/Entry.hpp>
9#include <stumpless/target/network.h>
A log entry.
Definition Entry.hpp:19
Network targets allow traditional syslog messages to be sent to a remote server.
Definition NetworkTarget.hpp:17
static NetworkTarget OpenTcp4Target(const char *name, const char *destination)
Creates a new network network target using TCP over IPv4 with the given parameters and opens it.
static NetworkTarget OpenUdp6Target(const char *name, const char *destination)
Creates a new network network target using UDP over IPv6 with the given parameters and opens it.
const char * GetName(void)
Returns the name of this target.
int GetOption(int option)
Gets the given option for this target.
NetworkTarget & SetDefaultAppName(const char *app_name)
Sets the default app name for this target.
static NetworkTarget OpenUdp4Target(const char *name, const char *destination)
Creates a new network network target using UDP over IPv4 with the given parameters and opens it.
static NetworkTarget OpenTcp6Target(const char *name, const char *destination)
Creates a new network network target using TCP over IPv6 with the given parameters and opens it.
NetworkTarget & SetUdpMaxMessageSize(size_t max_msg_size)
Sets the maximum message size of a UDP network target.
const char * GetDefaultAppName(void)
Returns the default app name used by this target.
static const char * DEFAULT_TRANSPORT_PORT
The default transport port for network targets.
Definition NetworkTarget.hpp:26
bool IsOpen(void)
Checks to see if this target is open.
NetworkTarget & UnsetOption(int option)
Unsets an option on a target.
NetworkTarget(struct stumpless_target *equivalent)
stumpless_filter_func_t GetFilter(void)
Returns the current filter used by this target to determine if entries should be allowed through it.
const char * GetDestination(void)
Gets the destination of the target.
NetworkTarget & Log(Entry entry)
Writes an Entry to this target.
~NetworkTarget(void)
Closes this target and releases all memory and other resources held by it.
const char * GetTransportPort(void)
Gets the transport port number of the target.
static NetworkTarget NewPausedUdp4Target(const char *name)
Creates a new network target using UDP over IPv4 with the given name.
NetworkTarget & SetDefaultMsgid(const char *msgid)
Sets the default message id for this target.
NetworkTarget & Log(const char *message,...)
Writes a string message to this target.
NetworkTarget & SetMask(int mask)
Sets the log mask of a target.
static NetworkTarget NewPausedTarget(const char *name, NetworkProtocol network_protocol, TransportProtocol transport_protocol)
Creates a new network target with the given parameters but does not open it.
void Open(void)
Opens this target if it has been paused.
Facility GetDefaultFacility(void)
Gets the default facility of this target.
NetworkTarget & SetDefaultFacility(int facility)
Sets the default facility of the target.
static NetworkTarget NewPausedUdp6Target(const char *name)
Creates a new network target using UDP over IPv6 with the given name.
NetworkTarget & SetFilter(stumpless_filter_func_t filter)
Sets the filter used by this target to determine whether entries should be logged to it.
static NetworkTarget NewPausedTcp6Target(const char *name)
Creates a new network target using TCP over IPv6 with the given name.
struct stumpless_target * equivalent
Definition NetworkTarget.hpp:35
NetworkTarget & Log(Facility facility, Severity severity, const char *message,...)
Writes a log message with the given facility and severity to this target.
NetworkTarget(const char *name, const char *destination, NetworkProtocol network_protocol, TransportProtocol transport_protocol)
Creates a new network target with the given parameters and opens it.
NetworkTarget & Log(int priority, const char *message,...)
Writes a log message with the given priority to this target.
size_t GetUdpMaxMessageSize(void)
Gets the current maximum message size of a UDP network target.
NetworkTarget & SetDestination(const char *destination)
Sets the destination of the target.
const char * GetDefaultMsgid(void)
Returns the default msgid used by this target.
static NetworkTarget NewPausedTcp4Target(const char *name)
Creates a new network target using TCP over IPv4 with the given name.
NetworkTarget & SetTransportPort(const char *port)
Sets the transport port of the target.
NetworkTarget & SetOption(int option)
Sets an option on a target.
int GetMask(void)
Gets the log mask of this target.
static const size_t DEFAULT_UDP_MAX_MESSAGE_SIZE
The default message size for UDP network targets.
Definition NetworkTarget.hpp:33
Definition AddressFailure.hpp:7
NetworkProtocol
Network protocols used by network targets.
Definition NetworkProtocol.hpp:11
Facility
Facilities (as defined in RFC 5424) describe the general classification of an event.
Definition Facility.hpp:17
TransportProtocol
Transport protocols used by network targets.
Definition TransportProtocol.hpp:11
Severity
Severities (as defined in RFC 5424) describe the level of importance of a given log entry.
Definition Severity.hpp:15