X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FSyslogUDPTarget.hh;h=6b7e2693f01416f19036d8baebe9dea2bff38ec5;hb=5746957b0da2bb228b9284e9493158c113b2bbe0;hp=a025c3ebb67b1fd3afb3b2db789465c8bcac8e74;hpb=adcd3672d48f44103f2b4abc6417acf5d0107978;p=senf.git diff --git a/Utils/Logger/SyslogUDPTarget.hh b/Utils/Logger/SyslogUDPTarget.hh index a025c3e..6b7e269 100644 --- a/Utils/Logger/SyslogUDPTarget.hh +++ b/Utils/Logger/SyslogUDPTarget.hh @@ -80,6 +80,11 @@ namespace log { space left so a relay may optionally add a timestamp and hostname section, the log messages are split after 896 characters. Additionally the log messages are split at each newline char since non-printable characters are not allowed. + + \implementation The RFC only \e recommends the exact message format. This allows us to + include the \c PRI part but skip the \c HEADER part (which includes the timestamp and + hostname) for better performance. We add a space after the \c PRI to force the syslog + daemon to skip the \c HEADER part. */ class SyslogUDPTarget : public Target @@ -100,23 +105,33 @@ namespace log { ///@} /////////////////////////////////////////////////////////////////////////// + void showStream(bool flag = true); + void showLevel(bool flag = true); + void showArea(bool flag = true); + + void tag(std::string const & tag); + private: void v_write(time_type timestamp, std::string const & stream, std::string const & area, unsigned level, std::string const & message); int facility_; + std::string tag_; typedef senf::ClientSocketHandle< senf::MakeSocketPolicy< senf::DatagramFramingPolicy, senf::ConnectedCommunicationPolicy, senf::WriteablePolicy>::policy > Handle; Handle handle_; + bool showStream_; + bool showLevel_; + bool showArea_; }; }} ///////////////////////////////hh.e//////////////////////////////////////// -//#include "SyslogUDPTarget.cci" +#include "SyslogUDPTarget.cci" //#include "SyslogUDPTarget.ct" //#include "SyslogUDPTarget.cti" #endif