Relying on the tail command is an old standby method that's frequently useful in watching logs. Unfortunately we also need to know which server won the leader race to know which logs to observe. We could use the list parameter for patronictl, yet the takeover process relies on several timeouts. The authors of Patroni considered this and added a -w flag to "watch" the command by running it upon a configurable interval.
This means we could observe the failover and takeover as it happened with a command like this:
patronictl list -w 5 -d pg1:2379 stampede
Of course, this isn't really a novel feature. It's extremely likely most Linux systems have the watch command installed, and it fills the same role. We could get the same ...