event-log-registration.md 871 字节
Newer Older
K
KyleZhang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
## 19.12. Registering Event Log on Windows

[]()

 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 [event\_source](runtime-config-logging.html#GUC-EVENT-SOURCE)), 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

```

### Note

 To enable event logging in the database server, modify [log\_destination](runtime-config-logging.html#GUC-LOG-DESTINATION) to include `eventlog` in `postgresql.conf`.