mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Add JSON log format to logging configuration (#2982)
Now patroni can be configured as bellow to log in json format.
```yaml
log:
type: json
format:
- asctime: '@timestamp'
- levelname: level
- message
- module
- name: logger_name
static_fields:
app: patroni
```
This config produce this log:
```json
{
"@timestamp": "2023-12-14 19:51:24,872",
"level": "INFO",
"message": "Lock owner: None; I am postgresql1",
"module": "ha",
"app": "patroni",
"logger_name": "patroni.ha"
}
```
This commit is contained in:
@@ -25,7 +25,7 @@ KEYWORDS = 'etcd governor patroni postgresql postgres ha haproxy confd' +\
|
||||
|
||||
EXTRAS_REQUIRE = {'aws': ['boto3'], 'etcd': ['python-etcd'], 'etcd3': ['python-etcd'],
|
||||
'consul': ['python-consul'], 'exhibitor': ['kazoo'], 'zookeeper': ['kazoo'],
|
||||
'kubernetes': [], 'raft': ['pysyncobj', 'cryptography']}
|
||||
'kubernetes': [], 'raft': ['pysyncobj', 'cryptography'], 'jsonlogger': ['python-json-logger']}
|
||||
|
||||
# Add here all kinds of additional classifiers as defined under
|
||||
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
|
||||
Reference in New Issue
Block a user