patroni
patroni copied to clipboard
Improve logging
Hi. After failover with pg_rewind after, I found that while pg_rewind is running, in addition to the data from the replica, the directory with the Postgres logs is also synchronized. This makes very difficult to find the causes of failovers (and in general loss of logs is undesirable under any circumstances). Maybe can somehow teach the patroni to save the Postgres log, or at least part of it? For example, before using pg_rewind, copy the X last lines from pg_current_logfile() to the patroni log
Hi,
I think this is to be managed outside Patroni. You can set Postgresql's "log_directory" parameter to an absolute path for the log folder, relocating the logs outside the PGDATA folder, and pg_rewind will skip it when replicating the data directory (and its folders), so it won't clobber the logs.
@alago197 Thanks for advice. I think you are right. I forgot about the log_destination parameter