Public Member Functions | |
TcpIpAppender (Formatter *formatter, const std::string &host, unsigned port=4448) | |
Constructs the appender and tries to open the connection. | |
TcpIpAppender (Formatter *formatter, long adr, unsigned port=4448) | |
Constructs the appender and tries to open the connection. | |
virtual | ~TcpIpAppender () |
Destroys the appender. | |
virtual void | append (Logger::Level level, std::string msg, std::string category, LOG4SENDPP_INT64 stamp, const LocationInformation *loginfo, const Logger::DiagnosticInformation *diaginfo) |
Formats a message. | |
virtual void | writeString (const std::string &data) |
Appends a string to the current file. | |
virtual bool | isWorking () const |
Tests if the appender is correctly working. | |
Static Public Member Functions | |
static std::string | gethostname () |
Gets the name of this host. | |
Protected Member Functions | |
void | open () |
Opens the connection. | |
void | close () |
Closes the connection. | |
Classes | |
struct | Impl |
internal More... |
Definition at line 45 of file tcpip_appender.h.
l4snd::TcpIpAppender::TcpIpAppender | ( | Formatter * | formatter, | |
const std::string & | host, | |||
unsigned | port = 4448 | |||
) |
Constructs the appender and tries to open the connection.
formatter | pointer to foratter | |
host | host name of log host | |
port | destination port. 4448 for default chainsaw configuration |
Definition at line 225 of file tcpip_appender.cpp.
References l4snd::TcpIpAppender::Impl::hostdata, LOG4SENDPP_CATCH_ALL, LOG4SENDPP_TRY, l4snd::TcpIpAppender::Impl::net_error, and open().
l4snd::TcpIpAppender::TcpIpAppender | ( | Formatter * | formatter, | |
long | adr, | |||
unsigned | port = 4448 | |||
) |
Constructs the appender and tries to open the connection.
formatter | pointer to foratter | |
adr | ip address of log host | |
port | destination port. 4448 for default chainsaw configuration |
Definition at line 186 of file tcpip_appender.cpp.
References l4snd::TcpIpAppender::Impl::hostdata, LOG4SENDPP_CATCH_ALL, LOG4SENDPP_TRY, l4snd::TcpIpAppender::Impl::net_error, and open().
void l4snd::TcpIpAppender::append | ( | Logger::Level | level, | |
std::string | msg, | |||
std::string | category, | |||
LOG4SENDPP_INT64 | stamp, | |||
const LocationInformation * | loginfo, | |||
const Logger::DiagnosticInformation * | diaginfo | |||
) | [virtual] |
Formats a message.
level | severty level | |
msg | string to log | |
category | message category | |
stamp | timestamp in milliseconds since 1.1.1970 | |
loginfo | pointer to location info or 0 | |
diaginfo | pointer to diagnostic info or 0 |
Implements l4snd::Appender.
Definition at line 346 of file tcpip_appender.cpp.
References l4snd::Formatter::format(), l4snd::Appender::getFormatter(), isWorking(), LOG4SENDPP_CATCH_ALL, LOG4SENDPP_RETHROW, LOG4SENDPP_TRY, l4snd::TcpIpAppender::Impl::net_error, and writeString().
void l4snd::TcpIpAppender::writeString | ( | const std::string & | data | ) | [virtual] |
Appends a string to the current file.
data | string with data |
Implements l4snd::Appender.
Definition at line 379 of file tcpip_appender.cpp.
References close(), l4snd::TcpIpAppender::Impl::fd_handle, isWorking(), LOG4SENDPP_THROW, l4snd::TcpIpAppender::Impl::net_error, and l4snd::TcpIpAppender::Impl::timeout.
Referenced by append().
bool l4snd::TcpIpAppender::isWorking | ( | ) | const [virtual] |
Tests if the appender is correctly working.
Implements l4snd::Appender.
Definition at line 291 of file tcpip_appender.cpp.
References l4snd::TcpIpAppender::Impl::fd_handle, and l4snd::TcpIpAppender::Impl::net_error.
Referenced by append(), and writeString().
std::string l4snd::TcpIpAppender::gethostname | ( | ) | [static] |
Gets the name of this host.
empty string in case of an error and disabled exception handling
Definition at line 203 of file tcpip_appender.cpp.
References LOG4SENDPP_THROW.
Referenced by l4snd::SimpleFormatter::SimpleFormatter(), and l4snd::XmlFormatter::XmlFormatter().