> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/server-administration/server-setup-and-operation/18.11.-zai-windows-zhu-ce-shi-jian-ri-zhi.md).

# 18.12. 在 Windows 註冊事件日誌

要在作業系統註冊 Windows 事件日誌，請使用以下指令：

```
regsvr32 pgsql_library_directory/pgevent.dll
```

這將建立事件檢視器使用的註冊機碼項目，該項目由名為 PostgreSQL 的預設事件來源建立。

要指定不同的事件來源名稱（請參閱 [event\_source](/server-administration/server-configuration/error-reporting-and-logging.md#event_source-string)），請使用 /n 和 /i 選項：

```
regsvr32 /n /i:event_source_name pgsql_library_directory/pgevent.dll
```

要從作業系統註銷事件日誌，請使用以下指令：

```
regsvr32 /u [/i:event_source_name] pgsql_library_directory/pgevent.dll
```

#### 注意

要在資料庫伺服器中啟用事件日誌記錄，請修改 postgresql.conf 中的 [log\_destination ](/server-administration/server-configuration/error-reporting-and-logging.md#log_destination-string)，使其包含 eventlog。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/server-administration/server-setup-and-operation/18.11.-zai-windows-zhu-ce-shi-jian-ri-zhi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
