1 // Module:  Log4CPLUS
 2 // File:    syslogappender.h
 3 // Created: 6/2001
 4 // Author:  Tad E. Smith
 5 //
 6 //
 7 // Copyright (C) Tad E. Smith  All rights reserved.
 8 //
 9 // This software is published under the terms of the Apache Software
10 // License version 1.1, a copy of which has been included with this
11 // distribution in the LICENSE.APL file.
12 //
13 
14 /** @file */
15 
16 #ifndef _LOG4CPLUS_SYSLOG_APPENDER_HEADER_
17 #define _LOG4CPLUS_SYSLOG_APPENDER_HEADER_
18 
19 #include <log4cplus/config.h>
20 
21 #if defined(HAVE_SYSLOG_H) && !defined(_WIN32)
22 #include <log4cplus/appender.h>
23 
24 namespace log4cplus {
25 
26     /**
27      * Appends log events to a file. 
28      */
29     class SysLogAppender : public Appender {
30     public:
31       // Ctors
32         SysLogAppender(const tstring& ident);
33         SysLogAppender(const log4cplus::helpers::Properties properties);
34 
35       // Dtor
36         virtual ~SysLogAppender();
37 
38       // Methods
39         virtual void close();
40 
41     protected:
42         virtual int getSysLogLevel(const LogLevel& ll) const;
43         virtual void append(const spi::InternalLoggingEvent& event);
44 
45       // Data
46         tstring ident;
47 
48     private:
49       // Disallow copying of instances of this class
50         SysLogAppender(const SysLogAppender&);
51         SysLogAppender& operator=(const SysLogAppender&);
52     };
53 
54 } // end namespace log4cplus
55 
56 #endif // defined(HAVE_SYSLOG_H)
57 
58 #endif // _LOG4CPLUS_SYSLOG_APPENDER_HEADER_


syntax highlighted by Code2HTML, v. 0.9.1