pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedSeparate log_destination, user specific
5+ messages / 3 participants
[nested] [flat]
* Separate log_destination, user specific
@ 2022-01-25 10:48 Daulat <daulat.dba@gmail.com>
2022-01-25 10:55 ` Re: Separate log_destination, user specific Holger Jakobs <holger@jakobs.com>
2022-01-25 10:57 ` Re: Separate log_destination, user specific Paul Smith <paul@pscs.co.uk>
0 siblings, 2 replies; 5+ messages in thread
From: Daulat @ 2022-01-25 10:48 UTC (permalink / raw)
To: pgsql-admin <pgsql-admin@lists.postgresql.org>
Hello Team,
Is it possible to set a separate log_destination for some users in
Postgres?
As I know all actions are recorded under the directory specified
by log_destination.
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 ?
Please suggest !
Thanks,
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Separate log_destination, user specific
2022-01-25 10:48 Separate log_destination, user specific Daulat <daulat.dba@gmail.com>
@ 2022-01-25 10:55 ` Holger Jakobs <holger@jakobs.com>
1 sibling, 0 replies; 5+ messages in thread
From: Holger Jakobs @ 2022-01-25 10:55 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
Am 25.01.22 um 11:48 schrieb Daulat:
> Hello Team,
>
> Is it possible to set a separate log_destination for some users in
> Postgres?
> As I know all actions are recorded under the directory specified
> by log_destination.
>
> 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 ?
>
> Please suggest !
>
> Thanks,
>
There is no setting for this, but of course you can set up a process
which is always watching the log and copying messages by user (or other
criteria) to other files.
Make sure that in case of log rotation your process switches to the new
current log file.
--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
Attachments:
OpenPGP_signature (application/pgp-signature, 202B) download
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Separate log_destination, user specific
2022-01-25 10:48 Separate log_destination, user specific Daulat <daulat.dba@gmail.com>
@ 2022-01-25 10:57 ` Paul Smith <paul@pscs.co.uk>
2022-01-25 11:00 ` Re: Separate log_destination, user specific Holger Jakobs <holger@jakobs.com>
1 sibling, 1 reply; 5+ messages in thread
From: Paul Smith @ 2022-01-25 10:57 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
On 25/01/2022 10:48, Daulat wrote:
> Is it possible to set a separate log_destination for some users in
> Postgres?
> As I know all actions are recorded under the directory specified
> by log_destination.
>
> 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)
--
Paul
Paul Smith Computer Services
support@pscs.co.uk - 01484 855800
--
Paul Smith Computer Services
Tel: 01484 855800
Vat No: GB 685 6987 53
Sign up for news & updates at http://www.pscs.co.uk/go/subscribe
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Separate log_destination, user specific
2022-01-25 10:48 Separate log_destination, user specific Daulat <daulat.dba@gmail.com>
2022-01-25 10:57 ` Re: Separate log_destination, user specific Paul Smith <paul@pscs.co.uk>
@ 2022-01-25 11:00 ` Holger Jakobs <holger@jakobs.com>
2022-01-25 11:26 ` Re: Separate log_destination, user specific Daulat <daulat.dba@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Holger Jakobs @ 2022-01-25 11:00 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
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 log_destination for some users in
>> Postgres?
>> As I know all actions are recorded under the directory specified
>> by log_destination.
>>
>> 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/docs/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 it 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??
Attachments:
OpenPGP_signature (application/pgp-signature, 202B) download
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Separate log_destination, user specific
2022-01-25 10:48 Separate log_destination, user specific Daulat <daulat.dba@gmail.com>
2022-01-25 10:57 ` Re: Separate log_destination, user specific Paul Smith <paul@pscs.co.uk>
2022-01-25 11:00 ` Re: Separate log_destination, user specific Holger Jakobs <holger@jakobs.com>
@ 2022-01-25 11:26 ` Daulat <daulat.dba@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: Daulat @ 2022-01-25 11:26 UTC (permalink / raw)
To: Holger Jakobs <holger@jakobs.com>; +Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>
Thanks All !
I don't want to loss any messages. I just want to track the dba user ( some
users) actions and to generate a report.
On Tue, 25 Jan, 2022, 4:30 pm Holger Jakobs, <holger@jakobs.com> wrote:
> 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 log_destination for some users in
> Postgres?
> As I know all actions are recorded under the directory specified
> by log_destination.
>
> 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/docs/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 it 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??
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2022-01-25 11:26 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 10:48 Separate log_destination, user specific Daulat <daulat.dba@gmail.com>
2022-01-25 10:55 ` Holger Jakobs <holger@jakobs.com>
2022-01-25 10:57 ` Paul Smith <paul@pscs.co.uk>
2022-01-25 11:00 ` Holger Jakobs <holger@jakobs.com>
2022-01-25 11:26 ` Daulat <daulat.dba@gmail.com>
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