From 3a6b99f03c66d2ea9bb5dd6ff20bec1ab3e2e6a4 Mon Sep 17 00:00:00 2001 From: Arthur Petukhovsky Date: Fri, 11 Aug 2023 17:18:07 +0200 Subject: [PATCH] proxy: improve http logs (#4976) Fix multiline logs on websocket errors and always print sql-over-http errors sent to the user. --- proxy/src/http/websocket.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxy/src/http/websocket.rs b/proxy/src/http/websocket.rs index 071382cfb9..794da17929 100644 --- a/proxy/src/http/websocket.rs +++ b/proxy/src/http/websocket.rs @@ -192,7 +192,7 @@ async fn ws_handler( if let Err(e) = serve_websocket(websocket, config, &cancel_map, session_id, host).await { - error!(session_id = ?session_id, "error in websocket connection: {e:?}"); + error!(session_id = ?session_id, "error in websocket connection: {e:#}"); } } .in_current_span(), @@ -221,6 +221,10 @@ async fn ws_handler( }, None => Value::Null, }; + error!( + ?code, + "sql-over-http per-client task finished with an error: {e:#}" + ); ( json!({ "message": message, "code": code }), HashMap::default(),