3 //=============================================================================
5 * @file Log_Msg_UNIX_Syslog.h
7 * @author Jerry D. De Master <jdemaster@rite-solutions.com>
9 //=============================================================================
11 #ifndef ACE_LOG_MSG_UNIX_SYSLOG_H
12 #define ACE_LOG_MSG_UNIX_SYSLOG_H
13 #include /**/ "ace/pre.h"
15 #include /**/ "ace/config-all.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #if !defined (ACE_LACKS_UNIX_SYSLOG)
23 #include "ace/Log_Msg_Backend.h"
24 #include "ace/Basic_Types.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 * @class ACE_Log_Msg_UNIX_Syslog
31 * @brief Implements an ACE_Log_Msg_Backend that logs messages to a UNIX
32 * system's syslog facility.
34 class ACE_Export ACE_Log_Msg_UNIX_Syslog
: public ACE_Log_Msg_Backend
38 ACE_Log_Msg_UNIX_Syslog () = default;
41 virtual ~ACE_Log_Msg_UNIX_Syslog ();
43 /// Open a new event log.
45 * Initialize the event logging facility.
46 * @param logger_key The name of the calling program. This name is
47 * used as the @c ident in the syslog entries. If
48 * it is 0 (no name), the application name as
49 * returned from ACE_Log_Msg::program_name() is used.
51 virtual int open (const ACE_TCHAR
*logger_key
);
53 /// Reset the backend.
56 /// Close the backend completely.
59 /// This is called when we want to log a message.
60 virtual ssize_t
log (ACE_Log_Record
&log_record
);
63 /// Convert an ACE_Log_Priority value to the corresponding syslog priority.
64 int convert_log_priority (ACE_UINT32 lm_priority
);
66 /// Convert an ACE_Log_Priority mask to the corresponding syslog mask value.
67 int convert_log_mask (int lm_mask
);
70 ACE_END_VERSIONED_NAMESPACE_DECL
72 #endif /* !ACE_LACKS_UNIX_SYSLOG */
74 #include /**/ "ace/post.h"
75 #endif /* ACE_LOG_MSG_UNIX_SYSLOG_H */