From d8ea33f2c02721c89c2434b9fda170afb7fe4999 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 25 Oct 2011 20:02:55 +0200 Subject: 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 --- doc/src/sgml/config.sgml | 25 +++++++++++++++++++++++ doc/src/sgml/installation.sgml | 13 ------------ doc/src/sgml/runtime.sgml | 46 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 13 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index fa2dcf336c4..3ace7dfa930 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3037,6 +3037,14 @@ local0.* /var/log/postgresql to the syslog daemon's configuration file to make it work. + + On Windows, when you use the eventlog + option for log_destination, you should + register an event source and its library with the operating + system so that the Windows Event Viewer can display event + log messages cleanly. + See for details. + @@ -3287,6 +3295,23 @@ local0.* /var/log/postgresql + + event_source (string) + + event_source configuration parameter + + + + When logging to event log is enabled, this parameter + determines the program name used to identify + PostgreSQL messages in + the log. The default is PostgreSQL. + This parameter can only be set in the postgresql.conf + file or on the server command line. + + + + diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 0410cff4aca..41b9009de05 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1551,19 +1551,6 @@ PostgreSQL, contrib and HTML documentation successfully made. Ready to install. - - Registering <application>eventlog</> on <systemitem - class="osname">Windows</>: - - To register a Windows eventlog - library with the operating system, issue this command after installation: - -regsvr32 pgsql_library_directory/pgevent.dll - - This creates registry entries used by the event viewer. - - - Uninstallation: diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 68ceff15303..86499c67ac5 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -2295,4 +2295,50 @@ ssh -L 63333:db.foo.com:5432 joe@shell.foo.com + + Registering <application>Event Log</> on <systemitem + class="osname">Windows</> + + + event log + event log + + + + To register a Windows + event log library with the operating system, + issue this command: + +regsvr32 pgsql_library_directory/pgevent.dll + + This creates registry entries used by the event viewer, under the default + event source named PostgreSQL. + + + + To specify a different event source name (see + ), use the /n + and /i options: + +regsvr32 /n /i:event_source_name pgsql_library_directory/pgevent.dll + + + + + To unregister the event log library from + the operating system, issue this command: + +regsvr32 /u [/i:event_source_name] pgsql_library_directory/pgevent.dll + + + + + + To enable event logging in the database server, modify + to include + eventlog in postgresql.conf. + + + + -- cgit v1.2.3