Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

SyslogAppender.hh

Go to the documentation of this file.
00001 /*
00002  * SyslogAppender.hh
00003  *
00004  * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
00005  * Copyright 2000, Bastiaan Bakker. All rights reserved.
00006  *
00007  * See the COPYING file for the terms of usage and distribution.
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

Generated at Mon Jun 11 01:25:09 2001 for log4cpp by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001