Skip to content

Document manual testing of receiving logs over syslog #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,41 @@ make integration_test

Note the integration tests require Docker, and will take a while to run through.

#### Test receiving Postgres logs over syslog

The ability to receive Postgres logs over syslog is not covered by
automated tests. To test this manually, you'll need to relay the
Postgres logs through a syslog daemon.

Here's one way to do that (assuming a locally running Postgres on a
Debian/Ubuntu system):

- `sudo apt install rsyslog`
- edit your Postgres config file and set `log_destination` to `syslog`
- add the following rsyslog configuration file at `/etc/rsyslog.d/51-postgres.conf`:
```
if $programname == 'postgres' then {
*.* action(
type="omfwd"
StreamDriver="ptcp"
StreamDriverMode="0"
template="RSYSLOG_SyslogProtocol23Format"
target="localhost" port="5514" protocol="tcp"
action.resumeRetryCount="100"
queue.type="linkedList" queue.size="10000"
)
}
```
you can pick another port if 5514 is not available
- `sudo service rsyslog restart`
- update your local collector configuration to monitor your local Postgres
- update the configuration to add `db_log_syslog_server = 0.0.0.0:5514`
(or whatever port you selected above)
- start the collector
- run `SELECT pg_reload_conf()` in Postgres

The collector should now be receiving Postgres logs via rsyslog.

### Build the Helm Docs

The Helm chart [`README.md` file](contrib/helm/pganalyze-collector/README.md) is
Expand Down
Loading