X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FSyslogTarget.hh;h=3de11ec78358dba355fa714e5b5dcbeafb3eb02d;hb=55d09e34a5b9a9c7af23cc5ecb0ab79d58757a2d;hp=bb1aa6c96e5829fc61efac4dba2f710d4524d1f9;hpb=778234c9180629e8985cf2395692124d957a9e5c;p=senf.git diff --git a/Utils/Logger/SyslogTarget.hh b/Utils/Logger/SyslogTarget.hh index bb1aa6c..3de11ec 100644 --- a/Utils/Logger/SyslogTarget.hh +++ b/Utils/Logger/SyslogTarget.hh @@ -36,15 +36,38 @@ namespace senf { namespace log { + /** \brief Log target writing to the syslog + + The SyslogTarget will send all log messages to the syslog at the given facility. + + Valid facility values (taken from man 3 syslog): + \par "" + LOG_AUTHPRIV, LOG_CRON, LOG_DAEMON, LOG_FTP, + LOG_KERN, LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, + LOG_LOCAL3, LOG_LOCAL4, LOG_LOCAL5, LOG_LOCAL6, + LOG_LOCAL7, LOG_LPR, LOG_MAIL, LOG_NEWS, + LOG_SYSLOG, LOG_USER, LOG_UUCP + + The default facility is LOG_USER. + + The SENF log levels are mapped to syslog levels in the following way: + + + + + + + + +
senf::log::VERBOSE \c LOG_DEBUG
senf::log::NOTICE \c LOG_INFO
senf::log::MESSAGE \c LOG_NOTICE
senf::log::IMPORTANT \c LOG_WARNING
senf::log::CRITICAL \c LOG_CRIT
senf::log::FATAL \c LOG_EMERG
+ + \ingroup targets + */ class SyslogTarget : public Target { public: /////////////////////////////////////////////////////////////////////////// - // Types - - - /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members ///@{ @@ -53,12 +76,11 @@ namespace log { ///@} /////////////////////////////////////////////////////////////////////////// - protected: + private: void v_write(time_type timestamp, std::string const & stream, std::string const & area, unsigned level, std::string const & message); - private: int facility_; static int const LEVELMAP_[8]; };