3 //=============================================================================
5 * @file Log_Msg_UNIX_Syslog.h
7 * $Id: Log_Msg_UNIX_Syslog.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Jerry D. De Master <jdemaster@rite-solutions.com>
11 //=============================================================================
13 #ifndef ACE_LOG_MSG_UNIX_SYSLOG_H
14 #define ACE_LOG_MSG_UNIX_SYSLOG_H
15 #include /**/ "ace/pre.h"
17 #include /**/ "ace/config-all.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #if !defined (ACE_LACKS_UNIX_SYSLOG)
25 #include "ace/Log_Msg_Backend.h"
27 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
30 * @class ACE_Log_Msg_UNIX_Syslog
32 * @brief Implements an ACE_Log_Msg_Backend that logs messages to a UNIX
33 * system's syslog facility.
35 class ACE_Export ACE_Log_Msg_UNIX_Syslog
: public ACE_Log_Msg_Backend
39 ACE_Log_Msg_UNIX_Syslog (void);
42 virtual ~ACE_Log_Msg_UNIX_Syslog (void);
44 /// Open a new event log.
46 * Initialize the event logging facility.
47 * @param logger_key The name of the calling program. This name is
48 * used as the @c ident in the syslog entries. If
49 * it is 0 (no name), the application name as
50 * returned from ACE_Log_Msg::program_name() is used.
52 virtual int open (const ACE_TCHAR
*logger_key
);
54 /// Reset the backend.
55 virtual int reset (void);
57 /// Close the backend completely.
58 virtual int close (void);
60 /// This is called when we want to log a message.
61 virtual ssize_t
log (ACE_Log_Record
&log_record
);
64 /// Convert an ACE_Log_Priority value to the corresponding syslog priority.
65 int convert_log_priority (ACE_UINT32 lm_priority
);
67 /// Convert an ACE_Log_Priority mask to the corresponding syslog mask value.
68 int convert_log_mask (int lm_mask
);
71 ACE_END_VERSIONED_NAMESPACE_DECL
73 #endif /* !ACE_LACKS_UNIX_SYSLOG */
75 #include /**/ "ace/post.h"
76 #endif /* ACE_LOG_MSG_UNIX_SYSLOG_H */