summaryrefslogtreecommitdiff
path: root/ace/Log_Msg_NT_Event_Log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Log_Msg_NT_Event_Log.cpp')
-rw-r--r--ace/Log_Msg_NT_Event_Log.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/ace/Log_Msg_NT_Event_Log.cpp b/ace/Log_Msg_NT_Event_Log.cpp
index 6a1375c0318..663465bfe23 100644
--- a/ace/Log_Msg_NT_Event_Log.cpp
+++ b/ace/Log_Msg_NT_Event_Log.cpp
@@ -5,6 +5,7 @@
#if defined (ACE_WIN32)
#include "ace/Log_Msg_NT_Event_Log.h"
+#include "ace/Log_Msg.h"
#include "ace/Log_Record.h"
ACE_RCSID(ace, Log_Msg_NT_Event_Log, "$Id$")
@@ -22,6 +23,7 @@ ACE_Log_Msg_NT_Event_Log::~ACE_Log_Msg_NT_Event_Log (void)
int
ACE_Log_Msg_NT_Event_Log::open (const ACE_TCHAR *logger_key)
{
+ ACE_UNUSED_ARG (logger_key);
// ACE's "resource module" contains the message resource required
// for event logging.
ACE_TCHAR msg_file [MAXPATHLEN];
@@ -33,13 +35,13 @@ ACE_Log_Msg_NT_Event_Log::open (const ACE_TCHAR *logger_key)
int msg_file_length = ACE_OS::strlen (msg_file);
// Information is stored in the registry at a location based on the
- // logger_key.
+ // program name.
ACE_TCHAR reg_key [MAXPATHLEN];
ACE_OS::strcpy (reg_key,
ACE_LIB_TEXT ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\"));
int reg_key_length = ACE_OS::strlen(reg_key);
ACE_OS::strncat (reg_key,
- logger_key,
+ ACE_Log_Msg::program_name (),
MAXPATHLEN - reg_key_length);
// Add the event source to the registry. Note that if this fails it
@@ -65,7 +67,7 @@ ACE_Log_Msg_NT_Event_Log::open (const ACE_TCHAR *logger_key)
RegCloseKey (hkey);
// Obtain a handle to the event source.
- this->evlog_handle_ = ACE_TEXT_RegisterEventSource (0, logger_key);
+ this->evlog_handle_ = ACE_TEXT_RegisterEventSource (0, ACE_Log_Msg::program_name ());
return this->evlog_handle_ ? 0 : -1;
}