Skip to content

Commit a051209

Browse files
authored
[DPE-2641] patroni logs (#240)
* Patroni log tweaks * Approximate minute rotation * Patroni log location * Log location
1 parent 77ad2cd commit a051209

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

templates/patroni.yml.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ name: {{ member_name }}
1313

1414
log:
1515
dir: {{ log_path }}
16+
dateformat: "%Y-%m-%d %H:%M:%S %Z"
17+
format: "%(asctime)s [%(process)d]: %(levelname)s: %(message)s "
18+
file_num: 10080
19+
file_size: 600
1620

1721
restapi:
1822
listen: '{{ self_ip }}:8008'
@@ -80,7 +84,7 @@ bootstrap:
8084
log_statement_sample_rate: 1
8185
log_statement_stats: 'off'
8286
log_temp_files: 1
83-
log_timezone: 'GMT'
87+
log_timezone: 'UTC'
8488
log_truncate_on_rotation: 'on'
8589
logging_collector: 'on'
8690
wal_level: logical

tests/integration/ha_tests/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ async def reused_replica_storage(ops_test: OpsTest, unit_name) -> bool:
778778
ops_test,
779779
unit_name,
780780
"grep 'Database cluster state: in archive recovery' "
781-
"/var/snap/charmed-postgresql/common/var/log/patroni/patroni.log",
781+
"/var/snap/charmed-postgresql/common/var/log/patroni/patroni.log*",
782782
)
783783
return True
784784

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

0 commit comments

Comments
 (0)