Log raw json-rpc messages #394
-
Hello! Is it possible to log the raw json-rpc of messages both received from the client and that are sent back to client? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey there! Line 141 in 7b58012 and here: Line 181 in 7b58012 respectively. Depending on which Hope this is helpful! |
Beta Was this translation helpful? Give feedback.
Hey there!
tower-lsp
includes built-in integration withtracing
for logging. The raw JSON-RPC payloads of both incoming (client-to-server) and outgoing (server-to-client) messages are recorded astrace!()
logs here:tower-lsp/src/codec.rs
Line 141 in 7b58012
and here:
tower-lsp/src/codec.rs
Line 181 in 7b58012
respectively.
Depending on which
tracing
subscriber you have set up, you should be able to filter by the "trace" log level emitted fromtower_lsp::codec
to view the raw messages. For instance, the example programs included in theexamples/
directory are set up using thefmt
subscriber. To view the ra…