Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Log_Msg_UNIX_Syslog.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Log_Msg_UNIX_Syslog.h
00006  *
00007  *  $Id: Log_Msg_UNIX_Syslog.h,v 1.1.1.2 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Jerry D. De Master <jdemaster@rite-solutions.com>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef ACE_LOG_MSG_UNIX_SYSLOG_H
00014 #define ACE_LOG_MSG_UNIX_SYSLOG_H
00015 #include "ace/pre.h"
00016 
00017 #include "ace/config-all.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #if !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SYSLOG)
00024 
00025 #include "ace/Log_Msg_Backend.h"
00026 
00027 /**
00028  * @class ACE_Log_Msg_UNIX_Syslog
00029  *
00030  * @brief Implements an ACE_Log_Msg_Backend that logs messages to a UNIX
00031  * system's syslog facility.
00032  */
00033 class ACE_Export ACE_Log_Msg_UNIX_Syslog : public ACE_Log_Msg_Backend
00034 {
00035 public:
00036   /// Constructor
00037   ACE_Log_Msg_UNIX_Syslog (void);
00038 
00039   /// Destructor
00040   virtual ~ACE_Log_Msg_UNIX_Syslog (void);
00041 
00042   /// Open a new event log.
00043   /**
00044    * Initialize the event logging facility.
00045    * @param logger_key The name of the calling program. This name is
00046    *                   used as the @arg ident in the syslog entries. If
00047    *                   it is 0 (no name), the application name as
00048    *                   returned from ACE_Log_Msg::program_name() is used.
00049    */
00050   virtual int open (const ACE_TCHAR *logger_key);
00051 
00052   /// Reset the backend.
00053   virtual int reset (void);
00054 
00055   /// Close the backend completely.
00056   virtual int close (void);
00057 
00058   /// This is called when we want to log a message.
00059   virtual int log (ACE_Log_Record &log_record);
00060 
00061 private:
00062   /// Convert an ACE_Log_Priority value to the corresponding syslog priority.
00063   int convert_log_priority (int lm_priority);
00064 
00065   /// Convert an ACE_Log_Priority mask to the corresponding syslog mask value.
00066   int convert_log_mask (int lm_mask);
00067 };
00068 
00069 #endif /* !ACE_WIN32 && !ACE_HAS_WINCE */
00070 
00071 #include "ace/post.h"
00072 #endif /* ACE_LOG_MSG_UNIX_SYSLOG_H */

Generated on Mon Jun 16 11:20:01 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002