Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCJZE-0005i4-71 for pgsql-admin@arkaria.postgresql.org; Tue, 25 Jan 2022 11:00:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCJZD-00012l-3Z for pgsql-admin@arkaria.postgresql.org; Tue, 25 Jan 2022 11:00:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCJZC-00012c-L4 for pgsql-admin@lists.postgresql.org; Tue, 25 Jan 2022 11:00:50 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCJZ9-0008BN-U1 for pgsql-admin@lists.postgresql.org; Tue, 25 Jan 2022 11:00:49 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id 514073805E3; Tue, 25 Jan 2022 12:00:46 +0100 (CET) Received: from rs.plausibolo.de ([127.0.0.1]) by localhost (h2367442.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pkpepDBFrgce; Tue, 25 Jan 2022 12:00:46 +0100 (CET) Received: from [192.168.178.197] (ip-037-201-154-229.um10.pools.vodafone-ip.de [37.201.154.229]) by rs.plausibolo.de (Postfix) with ESMTPSA id 68BB23805AA; Tue, 25 Jan 2022 12:00:45 +0100 (CET) Message-ID: Date: Tue, 25 Jan 2022 12:00:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: Separate log_destination, user specific Content-Language: de-DE To: pgsql-admin@lists.postgresql.org References: <066fa9a8-9e51-dd4d-83e6-4efcc8e36f53@pscs.co.uk> From: Holger Jakobs In-Reply-To: <066fa9a8-9e51-dd4d-83e6-4efcc8e36f53@pscs.co.uk> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------ELMpVrbTnp0k2oPme90L9wvF" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------ELMpVrbTnp0k2oPme90L9wvF Content-Type: multipart/mixed; boundary="------------BNvungpLEKGrJcT6acPRfJps"; protected-headers="v1" From: Holger Jakobs To: pgsql-admin@lists.postgresql.org Message-ID: Subject: Re: Separate log_destination, user specific References: <066fa9a8-9e51-dd4d-83e6-4efcc8e36f53@pscs.co.uk> In-Reply-To: <066fa9a8-9e51-dd4d-83e6-4efcc8e36f53@pscs.co.uk> --------------BNvungpLEKGrJcT6acPRfJps Content-Type: multipart/alternative; boundary="------------eNC7Gjn8GmNh2eElW0e8g9Dc" --------------eNC7Gjn8GmNh2eElW0e8g9Dc Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 QW0gMjUuMDEuMjIgdW0gMTE6NTcgc2NocmllYiBQYXVsIFNtaXRoOg0KPiBPbiAyNS8wMS8y MDIyIDEwOjQ4LCBEYXVsYXQgd3JvdGU6DQo+PiBJcyBpdCBwb3NzaWJsZSB0byBzZXQgYSBz ZXBhcmF0ZSBsb2dfZGVzdGluYXRpb24gZm9yIHNvbWUgdXNlcnPCoCBpbiANCj4+IFBvc3Rn cmVzPw0KPj4gQXMgSSBrbm93IGFsbCBhY3Rpb25zIGFyZSByZWNvcmRlZCB1bmRlciB0aGUg ZGlyZWN0b3J5wqBzcGVjaWZpZWQgDQo+PiBiecKgbG9nX2Rlc3RpbmF0aW9uLg0KPj4NCj4+ IEJ1dCBJIHdhbnQgdG8gY3JlYXRlIGEgc2VwYXJhdG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B0aGUgcmVzdCBvZiB0aGUgc3lzdGVtLg0KDQpEbyB5b3UgcmVhbGx5IHdhbnQgdG8gbG9z ZSBtZXNzYWdlcz8/DQoNCg== --------------eNC7Gjn8GmNh2eElW0e8g9Dc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Am 25.01.22 um 11:57 schrieb Paul Smith:
On 25/01/2022 10:48, Daulat wrote:
Is it possible to set a separate=C2=A0log_destination for some users=C2=A0 in Postgres?=C2=A0
As I know all actions are recorded under the directory=C2=A0specified by=C2=A0log_destination.=C2=A0

But I want to create a separate log file for DBA users to log their actions.
Is any third party or free ware tool available to accomplish this task ?


Could you set PostgreSQL to log to Syslog, and then set up filters in rsyslog?
(I've not done it, but it sounds like it may work)


Using syslog is not advisable. Qutoe from https://www.postgresql.org/d= ocs/current/runtime-config-logging.html

The logging collector is designed to never lose messages. This means that in case of extremely high load, server processes could be blocked while trying to send additional log messages when the collector has fallen behind. In contrast, syslog prefers to drop messages if i= t cannot write them, which means it may fail to log some messages in such cases but it will not block the rest of the system.

Do you really want to lose messages??

--------------eNC7Gjn8GmNh2eElW0e8g9Dc-- --------------BNvungpLEKGrJcT6acPRfJps-- --------------ELMpVrbTnp0k2oPme90L9wvF Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQScuJCxWJK1p5BOebGKV5yTsxlhugUCYe/YXAUDAAAAAAAKCRCKV5yTsxlhuvER AJ9PFeGX4ksDYnBBw3ofhITnQjllfwCfXSD05YIlmCZxNstbLOEe31gIIAQ= =GTAi -----END PGP SIGNATURE----- --------------ELMpVrbTnp0k2oPme90L9wvF--