00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _LOG4CPP_SYSLOGAPPENDER_HH
00011 #define _LOG4CPP_SYSLOGAPPENDER_HH
00012
00013 #include <string>
00014 #include <stdarg.h>
00015 #include <syslog.h>
00016 #include "log4cpp/AppenderSkeleton.hh"
00017 #include "log4cpp/Priority.hh"
00018
00019 namespace log4cpp {
00020
00024 class SyslogAppender : public AppenderSkeleton {
00025 public:
00026
00032 static int toSyslogPriority(Priority::Value priority);
00033
00043 SyslogAppender(const std::string& name, const std::string& syslogName,
00044 int facility = LOG_USER);
00045 virtual ~SyslogAppender();
00046
00050 virtual bool reopen();
00051
00055 virtual void close();
00056
00061 virtual bool requiresLayout() const;
00062
00063 virtual void setLayout(Layout* layout);
00064
00065 protected:
00066
00070 virtual void open();
00071
00076 virtual void _append(const LoggingEvent& event);
00077
00078 const std::string _syslogName;
00079 int _facility;
00080 Layout* _layout;
00081 };
00082 }
00083
00084 #endif // _LOG4CPP_SYSLOGAPPENDER_HH