feat: Add JSON logging
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
18cbc70495
commit
e72feaf0f6
8 changed files with 77 additions and 13 deletions
|
|
@ -131,5 +131,13 @@ The following placeholders are available to format log messages using `log-forma
|
|||
* `%q`: query
|
||||
* `%a`: application name
|
||||
|
||||
Set `log-format` to `json` to log each session as a JSON object instead:
|
||||
|
||||
```
|
||||
pgterminate -log-format json
|
||||
```
|
||||
|
||||
Keys are `pid`, `user`, `database`, `client`, `state`, `query`, `state_duration` and `application_name`. With `log-destination: file`, a `timestamp` key is added to each object.
|
||||
|
||||
# License
|
||||
`pgterminate` is released under [The Unlicense](LICENSE) license. Code is under public domain.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue