[syslog-ng] PostgreSQL destination - connection refused

victorsugo victorsugo at protonmail.com
Sat Feb 6 10:16:22 UTC 2021


Hi,

I'd like to store incoming log messages in a postgres db.
Both db server and syslog-ng run in a docker container.
I'm using docker-compose to manage containers. The syslog-ng is depending on the pg container, but... every time I start containers with docker-compose up -d, the syslog-ng starts, but can't connect to database.

I found this in the /var/log/messages on the syslog-ng's container:
err syslog-ng[1]: Error establishing SQL connection; type='pgsql', host='pgsrv.infra-net', port='', username='syslog', database='postgres', error='could not connect to server: Connection refused ...

Is there any way to reconnect automatically or abort syslog-ng if it can't connect to the db?
It is important if I don't want to lose some logs...
(or do I need to forget the SQL backend if I want to operate a log server without loss of data??)

Regards,

Sent with [ProtonMail](https://protonmail.com) Secure Email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20210206/d9dc34a7/attachment.html>


More information about the syslog-ng mailing list