[syslog-ng] PostgreSQL destination - connection refused

victorsugo victorsugo at protonmail.com
Sat Feb 6 12:01:13 UTC 2021


Sorry, forget it please!
It was my fault.

Because the database was empty after starting all containers, and I've found that error message in /var/log/messages, I thought the syslog-ng stopped writing to the database.
Actually, the other containers started before the logger, so they can't send startup logs to it.

Sorry...

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, February 6, 2021 11:16 AM, victorsugo <victorsugo at protonmail.com> wrote:

> 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/c618349a/attachment.html>


More information about the syslog-ng mailing list