Gentler logging for socket errors#56
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces log noise by downgrading connection error logging from error to debug level for Unix socket connections, recognizing that these errors commonly occur during normal client disconnection and are not indicative of actual problems. The socket path is also added to the log message for better diagnostics.
Key Changes
- Changed Unix socket connection error logging from error to debug level with explanatory comment
- Added socket path information to the log message for better diagnostics
- Cloned the socket path before the async block to enable its use in the spawned task
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Connection shutdown errors are common and expected when clients | ||
| // disconnect - only log at debug level to avoid noise | ||
| let socket_info = socket_path.as_deref().unwrap_or("unknown"); | ||
| log::debug!("Unix socket connection ended ({}): {}", socket_info, e); |
There was a problem hiding this comment.
The logging change to debug level for connection errors is only applied to Unix sockets. For consistency, the same change should be applied to the TCP server (line 333) and Windows named pipe server (line 474), as connection shutdown errors are equally common and expected in those contexts when clients disconnect.
These "errors" can happen in fairly innocuous situations, such as the client not closing the connection when making an HTTP request (just a hygiene thing). Log them at debug, not error, and indicate the socket involved.