hapostgres / pg_auto_failover

Postgres extension and service for automated failover and high-availability
Other
1.09k stars 114 forks source link

feature request custom log file location #834

Closed Tiago-Anastacio closed 2 years ago

Tiago-Anastacio commented 2 years ago

Salut Dimitri,

some admin and security teams can be very upset and refuse usage of journalctl for logs.

Aim of ticket is to provide an option for allocate pg_autoctl logs on a custom location (directory + file) .

I understand one of pg_autofailover goals is to be easy to configure.

But here we have some kind of security arguments...

Currently for me it's a kind of show stopper to go to production with pg_autoctl

Merci

Tiago

redbaron commented 2 years ago

related to https://github.com/citusdata/pg_auto_failover/issues/389

DimCitus commented 2 years ago

Hi @Tiago-DBA and @redbaron ; as you're already using systemd it seems to me that this is a systemd question. Specifically, have a look at the StandardOutput= option docs including the file: and append: support, and tweak your systemd setup according to your needs.

Remember that the pg_autoctl show systemd command outputs a template to help users get started. I strongly believe it's part of the local admin job to review and adapt this template to what they actually require for their production setup, and as a result I don't think we should be able to take care of every possible case in pg_autoctl itself.

It used to be that every single service (daemon) on a Unix system had to implement all-over again all the system integration shenanigans, including log file rotation and syslog compatibility and all the jazz. It seems to me that nowadays a service is expected to output to stdout and be done with it, then another component of the OS has the job of handling the logs. In your case, because you're using systemd, then that job falls onto systemd, I would argue.

Tiago-Anastacio commented 2 years ago

Thanks Dimitri, it is very clear pg_autoctl -d provides log to stdout, so we can customize using the service system tool in charge of launching pg_autoctl. So feature is already provided.