# fix\(server\): log the close code and reason when a /ws connection ends · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/17cec6d6f0f014be8ea36bf8184216423204231f)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 17cec6d6f0f014be8ea36bf8184216423204231f

Requested commit: 17cec6d6f0f014be8ea36bf8184216423204231f

Commit: 17cec6d6f0f014be8ea36bf8184216423204231f

Tree: cd29840560edaba2953514ebb094488ad6dbb921

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): log the close code and reason when a /ws connection ends

Effect's RPC server swallows the socket's close error, so a client close
left only the HTTP 101 in the log. The upgraded socket now records the
close code and reason before that, and each connection ends with one
`WebSocket closed` line: how it ended, code, reason, duration, last
inbound frame age, session, surface and address.

Adapted from the WsConnectionLog in #24285 by only21mil.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

```

## Parents

- [132f0b60c017ec046522b2c63b9947e6122a6705](https://git.cafe/pingdotgg/t3code/commit/132f0b60c017ec046522b2c63b9947e6122a6705?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/17cec6d6f0f014be8ea36bf8184216423204231f?format=markdown)
