From: Erik Wienhold <ewie@ewie.name>
To: ertan.kucukoglu@1nar.com.tr
To: pgsql-general@lists.postgresql.org
Subject: Re: Suppress logging of "pg_hba.conf rejects connection for host"
Date: Sun, 16 Apr 2023 17:51:58 +0200 (CEST)
Message-ID: <751523480.271967.1681660318625@office.mailbox.org> (raw)
In-Reply-To: <009701d97074$75f02550$61d06ff0$@1nar.com.tr>
References: <009701d97074$75f02550$61d06ff0$@1nar.com.tr>
> On 16/04/2023 17:02 CEST ertan.kucukoglu@1nar.com.tr wrote:
>
> One of the systems running PostgreSQL 14.7 receive a lot of lines like in
> the subject. I have below pg_hba.conf line and that line causes these to be
> logged.
>
> host all all 0.0.0.0/0 reject
>
> If possible, I do not want to see these lines in my logs. But, I failed to
> find a parameter for it.
>
> Is it possible to turn this specific message logging off?
There's no special config for this specific error message. It is logged as
FATAL so the only way to silence it *and any other messages from DEBUG5 to FATAL*
is to set log_min_messages = PANIC. I don't recommend it. It also complicates
troubleshooting failing connections in the future if you don't log this message.
When logging to syslog you may be able to discard specific messages.
rsyslog has property-based filters[0] for example:
:msg, contains, "pg_hba.conf rejects connection for host" ~
You should also investigate the clients that try connecting ("a lot" as you
write) and figure out why they keep connecting if you want to reject their
attempts anyway.
[0] https://rsyslog.readthedocs.io/en/latest/configuration/filters.html#property-based-filters
--
Erik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ewie@ewie.name, ertan.kucukoglu@1nar.com.tr
Subject: Re: Suppress logging of "pg_hba.conf rejects connection for host"
In-Reply-To: <751523480.271967.1681660318625@office.mailbox.org>
References: <009701d97074$75f02550$61d06ff0$@1nar.com.tr> <751523480.271967.1681660318625@office.mailbox.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox