Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions en/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ You can then run your automated tests to see what fails, and fix problems accord
<li><a href="#res.send.status">res.send(status)</a></li>
<li><a href="#res.sendfile">res.sendfile()</a></li>
<li><a href="#express.static.mime">express.static.mime</a></li>
<li><a href="#express:router-debug-logs">express:router debug logs</a></li>
</ul>

**Changed**
Expand Down Expand Up @@ -278,6 +279,25 @@ const mime = require('mime-types')
mime.lookup('json')
```

<h4 id="express:router-debug-logs">express:router debug logs</h4>

In Express 5, router handling logic is performed by a dependency. Therefore, the
debug logs for the router are no longer available under the `express:` namespace.
In v4, the logs were available under the namespaces `express:router`, `express:router:layer`,
and `express:router:route`. All of these were included under the namespace `express:*`.
In v5.1+, the logs are available under the namespaces `router`, `router:layer`, and `router:route`.
The logs from `router:layer` and `router:route` are included in the namespace `router:*`.
To achieve the same detail of debug logging when using `express:*` in v4, use a conjunction of
`express:*`, `router`, and `router:*`.

```sh
# v4
DEBUG=express:* node index.js

# v5
DEBUG=express:*,router,router:* node index.js
```

<h3>Changed</h3>

<h4 id="path-syntax">Path route matching syntax</h4>
Expand Down