SyslogChannel.h
Go to the documentation of this file.
00001 //
00002 // SyslogChannel.h
00003 //
00004 // $Id: //poco/1.3/Foundation/include/Poco/SyslogChannel.h#1 $
00005 //
00006 // Library: Foundation
00007 // Package: Logging
00008 // Module:  SyslogChannel
00009 //
00010 // Definition of the SyslogChannel class specific to UNIX.
00011 //
00012 // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
00013 // and Contributors.
00014 //
00015 // Permission is hereby granted, free of charge, to any person or organization
00016 // obtaining a copy of the software and accompanying documentation covered by
00017 // this license (the "Software") to use, reproduce, display, distribute,
00018 // execute, and transmit the Software, and to prepare derivative works of the
00019 // Software, and to permit third-parties to whom the Software is furnished to
00020 // do so, all subject to the following:
00021 // 
00022 // The copyright notices in the Software and this entire statement, including
00023 // the above license grant, this restriction and the following disclaimer,
00024 // must be included in all copies of the Software, in whole or in part, and
00025 // all derivative works of the Software, unless such copies or derivative
00026 // works are solely in the form of machine-executable object code generated by
00027 // a source language processor.
00028 // 
00029 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00030 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00031 // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
00032 // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
00033 // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
00034 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00035 // DEALINGS IN THE SOFTWARE.
00036 //
00037 
00038 
00039 #ifndef Foundation_SyslogChannel_INCLUDED
00040 #define Foundation_SyslogChannel_INCLUDED
00041 
00042 
00043 #include "Poco/Foundation.h"
00044 #include "Poco/Channel.h"
00045 
00046 
00047 namespace Poco {
00048 
00049 
00050 class Foundation_API SyslogChannel: public Channel
00052 {
00053 public:
00054         enum Option
00055         {
00056                 SYSLOG_PID    = 0x01, 
00057                 SYSLOG_CONS   = 0x02, 
00058                 SYSLOG_NDELAY = 0x08, 
00059                 SYSLOG_PERROR = 0x20  
00060         };
00061         
00062         enum Facility
00063         {
00064                 SYSLOG_KERN     = ( 0<<3), 
00065                 SYSLOG_USER     = ( 1<<3), 
00066                 SYSLOG_MAIL     = ( 2<<3), 
00067                 SYSLOG_DAEMON   = ( 3<<3), 
00068                 SYSLOG_AUTH     = ( 4<<3), 
00069                 SYSLOG_SYSLOG   = ( 5<<3), 
00070                 SYSLOG_LPR      = ( 6<<3), 
00071                 SYSLOG_NEWS     = ( 7<<3), 
00072                 SYSLOG_UUCP     = ( 8<<3), 
00073                 SYSLOG_CRON     = ( 9<<3), 
00074                 SYSLOG_AUTHPRIV = (10<<3), 
00075                 SYSLOG_FTP      = (11<<3), 
00076                 SYSLOG_LOCAL0   = (16<<3), 
00077                 SYSLOG_LOCAL1   = (17<<3), 
00078                 SYSLOG_LOCAL2   = (18<<3), 
00079                 SYSLOG_LOCAL3   = (19<<3), 
00080                 SYSLOG_LOCAL4   = (20<<3), 
00081                 SYSLOG_LOCAL5   = (21<<3), 
00082                 SYSLOG_LOCAL6   = (22<<3), 
00083                 SYSLOG_LOCAL7   = (23<<3)  
00084         };
00085         
00086         SyslogChannel();
00088                 
00089         SyslogChannel(const std::string& name, int options = SYSLOG_CONS, int facility = SYSLOG_USER);
00091         
00092         void open();
00094                 
00095         void close();
00097                 
00098         void log(const Message& msg);
00100                 
00101         void setProperty(const std::string& name, const std::string& value);
00108                 
00109         std::string getProperty(const std::string& name) const;
00111 
00112         static const std::string PROP_NAME;
00113         static const std::string PROP_FACILITY;
00114         static const std::string PROP_OPTIONS;
00115 
00116 protected:
00117         ~SyslogChannel();
00118         static int getPrio(const Message& msg);
00119 
00120 private:
00121         std::string _name;
00122         int  _options;
00123         int  _facility;
00124         bool _open;
00125 };
00126 
00127 
00128 } // namespace Poco
00129 
00130 
00131 #endif // Foundation_SyslogChannel_INCLUDED


pluginlib
Author(s): Tully Foote and Eitan Marder-Eppstein
autogenerated on Sat Dec 28 2013 17:20:19