<div>Sorry, forget it please!<br></div><div>It was my fault.<br></div><div><br></div><div>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.<br></div><div>Actually, the other containers started before the logger, so they can't send startup logs to it.<br></div><div><br></div><div>Sorry...<br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br></div><div class="protonmail_signature_block-proton">Sent with <a href="https://protonmail.com" target="_blank">ProtonMail</a> Secure Email.<br></div></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Saturday, February 6, 2021 11:16 AM, victorsugo <victorsugo@protonmail.com> wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><div>Hi,<br></div><div><br></div><div>I'd like to store incoming log messages in a postgres db.<br></div><div>Both db server and syslog-ng run in a docker container.<br></div><div>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.<br></div><div><br></div><div>I found this in the /var/log/messages on the syslog-ng's container:<br></div><div>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 ...<br></div><div><br></div><div>Is there any way to reconnect automatically or abort syslog-ng if it can't connect to the db?<br></div><div>It is important if I don't want to lose some logs...<br></div><div>(or do I need to forget the SQL backend if I want to operate a log server without loss of data??)<br></div><div><br></div><div><br></div><div>Regards,<br></div><div><br></div><div><br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br></div><div class="protonmail_signature_block-proton">Sent with <a href="https://protonmail.com" target="_blank">ProtonMail</a> Secure Email.<br></div></div><div><br></div></blockquote><div><br></div>