1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

Support configurable eventlog application names on Windows

This allows different instances to use the eventlog with different
identifiers, by setting the event_source GUC, similar to how
syslog_ident works.

Original patch by MauMau, heavily modified by Magnus Hagander
This commit is contained in:
Magnus Hagander
2011-10-25 20:02:55 +02:00
parent 90d8e8ff7e
commit d8ea33f2c0
8 changed files with 143 additions and 19 deletions

View File

@@ -123,6 +123,7 @@ static void write_syslog(int level, const char *line);
static void write_console(const char *line, int len);
#ifdef WIN32
extern char *event_source;
static void write_eventlog(int level, const char *line, int len);
#endif
@@ -1673,7 +1674,7 @@ write_eventlog(int level, const char *line, int len)
if (evtHandle == INVALID_HANDLE_VALUE)
{
evtHandle = RegisterEventSource(NULL, "PostgreSQL");
evtHandle = RegisterEventSource(NULL, event_source ? event_source : "PostgreSQL");
if (evtHandle == NULL)
{
evtHandle = INVALID_HANDLE_VALUE;