comparison mod_log_json/README.markdown @ 3736:3784bbcbb8ff

mod_log_json: Prettify JSON for readability
author Kim Alvefur <zash@zash.se>
date Sun, 03 Nov 2019 14:47:00 +0100
parents 06b640473cda
children e43a82ddde12
comparison
equal deleted inserted replaced
3735:06b640473cda 3736:3784bbcbb8ff
19 19
20 JSON log files consist of a series of `\n`-separated JSON objects, 20 JSON log files consist of a series of `\n`-separated JSON objects,
21 suitable for mangling with tools like 21 suitable for mangling with tools like
22 [`jq`](https://stedolan.github.io/jq/). 22 [`jq`](https://stedolan.github.io/jq/).
23 23
24 Example (with whitespace and indentation for readability):
25
24 ``` {.json} 26 ``` {.json}
25 {"message":"Client connected","source":"c2s55f267f5b9d0","datetime":"2019-11-03T13:38:28Z","level":"info","args":[]} 27 {
26 {"message":"load_roster: asked for: %s","source":"rostermanager","datetime":"2019-11-03T13:38:28Z","level":"debug","args":["user@example.net"]} 28 "args" : [],
29 "datetime" : "2019-11-03T13:38:28Z",
30 "level" : "info",
31 "message" : "Client connected",
32 "source" : "c2s55f267f5b9d0"
33 }
34 {
35 "args" : [
36 "user@example.net"
37 ],
38 "datetime" : "2019-11-03T13:38:28Z",
39 "level" : "debug",
40 "message" : "load_roster: asked for: %s",
41 "source" : "rostermanager"
42 }
27 ``` 43 ```
28 44
29 `datetime` 45 `datetime`
30 : [XEP-0082]-formatted timestamp. 46 : [XEP-0082]-formatted timestamp.
31 47