Skip to content

Commit

Permalink
[DPE-2641] patroni logs (canonical#240)
Browse files Browse the repository at this point in the history
* Patroni log tweaks

* Approximate minute rotation

* Patroni log location

* Log location
  • Loading branch information
dragomirp authored Oct 11, 2023
1 parent f67aaf8 commit 21aea5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion templates/patroni.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ name: {{ member_name }}

log:
dir: {{ log_path }}
dateformat: "%Y-%m-%d %H:%M:%S %Z"
format: "%(asctime)s [%(process)d]: %(levelname)s: %(message)s "
file_num: 10080
file_size: 600

restapi:
listen: '{{ self_ip }}:8008'
Expand Down Expand Up @@ -80,7 +84,7 @@ bootstrap:
log_statement_sample_rate: 1
log_statement_stats: 'off'
log_temp_files: 1
log_timezone: 'GMT'
log_timezone: 'UTC'
log_truncate_on_rotation: 'on'
logging_collector: 'on'
wal_level: logical
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/ha_tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ async def reused_replica_storage(ops_test: OpsTest, unit_name) -> bool:
ops_test,
unit_name,
"grep 'Database cluster state: in archive recovery' "
"/var/snap/charmed-postgresql/common/var/log/patroni/patroni.log",
"/var/snap/charmed-postgresql/common/var/log/patroni/patroni.log*",
)
return True

Expand All @@ -792,6 +792,6 @@ async def reused_full_cluster_recovery_storage(ops_test: OpsTest, unit_name) ->
ops_test,
unit_name,
"grep -E 'Database cluster state: in archive recovery|Database cluster state: shut down' "
"/var/snap/charmed-postgresql/common/var/log/patroni/patroni.log",
"/var/snap/charmed-postgresql/common/var/log/patroni/patroni.log*",
)
return True

0 comments on commit 21aea5f

Please sign in to comment.