mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-11 12:31:58 +01:00
887fa4b66b
`matrix://` is a registered specced scheme nowadays and doesn't make sense for our internal to Synapse use case anymore. ([discussion] (https://github.com/matrix-org/synapse/pull/15773#discussion_r1227598679)) |
||
---|---|---|
.. | ||
README.md | ||
synapse-log-format.json |
lnav
config for Synapse logs
lnav is a log-viewing tool. It is particularly useful when
you need to interleave multiple log files, or for exploring a large log file
with regex filters. The downside is that it is not as ubiquitous as tools like
less
, grep
, etc.
This directory contains an lnav
log format definition for Synapse logs as
emitted by Synapse with the default logging configuration. It supports lnav 0.10.1 because that's what's packaged by my distribution.
This should allow lnav:
- to interpret timestamps, allowing log interleaving;
- to interpret log severity levels, allowing colouring by log level(!!!);
- to interpret request IDs, allowing you to skip through a specific request; and
- to highlight room, event and user IDs in logs.
See also https://gist.github.com/benje/e2ab750b0a81d11920d83af637d289f7 for a similar example.
Example
Tips
lnav -i /path/to/synapse/checkout/contrib/lnav/synapse-log-format.json
lnav my_synapse_log_file
orlnav synapse_log_files.*
, etc.lnav --help
for CLI help.
Within lnav itself:
?
for help within lnav itself.q
to quit./
to search a-laless
andvim
, thenn
andN
to continue searching down and up.- Use
o
andO
to skip through logs based on the request ID (POST-1234
, or else the value of therequest_id_header
header). This may get confused if the same request ID is repeated among multiple files or process restarts. - ???
- Profit