Re: Fwd: Log file

From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Fwd: Log file
Date: 2018-11-11 16:24:11
Message-ID: 20181111162411.qph4hoo4jqwobboe@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-odbc

On 2018-10-29 14:56:06 -0400, Tom Lane wrote:
> Igor Korot <ikorot01(at)gmail(dot)com> writes:
> > Or I will have to change the owner/group manuall every time I will
> > access the file?
>
> You can set up the log files as readable by the OS group of the server
> (see log_file_mode), and then grant membership in that group to whichever
> OS accounts you trust.

Another way is to use ACLs. Set a default ACL on the log directory which
enforces read permission for some users or groups on all newly created
files.

This is a bit more fine-grained and may be better suited for situations
where different people should be able to read the logs of different
servers. I also find that ACLs are more likely to survive "corrective"
actions by update or init scripts.

Another way would be to log via syslog and configure syslogd to split
the log files according to the username embedded in the log message.

hp

--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp(at)hjp(dot)at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Gierth 2018-11-11 17:41:49 Re: query patterns for multipass aggregating
Previous Message Rob Nikander 2018-11-11 16:20:23 query patterns for multipass aggregating

Browse pgsql-odbc by date

  From Date Subject
Next Message Quan Zongliang 2018-11-13 00:22:04 ODBC SQLSpecialColumns bugfix
Previous Message Markus Angst 2018-11-07 17:11:57 Re: Out of memory while reading tuples