|
| 1 | +# Request log format |
| 2 | + |
| 3 | +HTTP request logs are written by synapse (see [`site.py`](../synapse/http/site.py) for details). |
| 4 | + |
| 5 | +See the following for how to decode the dense data available from the default logging configuration. |
| 6 | + |
| 7 | +``` |
| 8 | +2020-10-01 12:00:00,000 - synapse.access.http.8008 - 311 - INFO - PUT-1000- 192.168.0.1 - 8008 - {another-matrix-server.com} Processed request: 0.100sec/-0.000sec (0.000sec, 0.000sec) (0.001sec/0.090sec/3) 11B !200 "PUT /_matrix/federation/v1/send/1600000000000 HTTP/1.1" "Synapse/1.20.1" [0 dbevts] |
| 9 | +-AAAAAAAAAAAAAAAAAAAAA- -BBBBBBBBBBBBBBBBBBBBBB- -C- -DD- -EEEEEE- -FFFFFFFFF- -GG- -HHHHHHHHHHHHHHHHHHHHHHH- -IIIIII- -JJJJJJJ- -KKKKKK-, -LLLLLL- -MMMMMMM- -NNNNNN- O -P- -QQ- -RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR- -SSSSSSSSSSSS- -TTTTTT- |
| 10 | +``` |
| 11 | + |
| 12 | + |
| 13 | +| Part | Explanation | |
| 14 | +| ----- | ------------ | |
| 15 | +| AAAA | Timestamp request was logged (not recieved) | |
| 16 | +| BBBB | Logger name (`synapse.access.(http\|https).<tag>`, where 'tag' is defined in the `listeners` config section, normally the port) | |
| 17 | +| CCCC | Line number in code | |
| 18 | +| DDDD | Log Level | |
| 19 | +| EEEE | Request Identifier (This identifier is shared by related log lines)| |
| 20 | +| FFFF | Source IP (Or X-Forwarded-For if enabled) | |
| 21 | +| GGGG | Server Port | |
| 22 | +| HHHH | Federated Server or Local User making request (blank if unauthenticated or not supplied) | |
| 23 | +| IIII | Total Time to process the request | |
| 24 | +| JJJJ | Time to send response over network once generated (this may be negative if the socket is closed before the response is generated)| |
| 25 | +| KKKK | Userland CPU time | |
| 26 | +| LLLL | System CPU time | |
| 27 | +| MMMM | Total time waiting for a free DB connection from the pool across all parallel DB work from this request | |
| 28 | +| NNNN | Total time waiting for response to DB queries across all parallel DB work from this request | |
| 29 | +| OOOO | Count of DB transactions performed | |
| 30 | +| PPPP | Response body size | |
| 31 | +| QQQQ | Response status code (prefixed with ! if the socket was closed before the response was generated) | |
| 32 | +| RRRR | Request | |
| 33 | +| SSSS | User-agent | |
| 34 | +| TTTT | Events fetched from DB to service this request (note that this does not include events fetched from the cache) | |
| 35 | + |
| 36 | + |
| 37 | +MMMM / NNNN can be greater than IIII if there are multiple slow database queries |
| 38 | +running in parallel. |
| 39 | + |
| 40 | +Some actions can result in multiple identical http requests, which will return |
| 41 | +the same data, but only the first request will report time/transactions in |
| 42 | +`KKKK`/`LLLL`/`MMMM`/`NNNN`/`OOOO` - the others will be awaiting the first query to return a |
| 43 | +response and will simultaneously return with the first request, but with very |
| 44 | +small processing times. |
0 commit comments