You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DEBUG=express:* does not work in express@5.0.1 #6280
Debugging Express said
"To see all the internal logs used in Express, set the DEBUG environment variable to express:* when launching your app." DEBUG=express:* node index.js
But it does not work in express@5.0.1
There is also no answer on Moving to Express 5
express:application scope debugging is coming through fine.
But notably express:router is not coming through. In v5 router was moved out into another package, seems to have dropped the debug lib. I dont know that the exclusion was on purpose, cc @wesleytodd
An aside, splitting like this makes it more difficult to debug router under the express:* namespace. Not impossible, but something to solve for.
This doesn't seem to be a bug, it was done in this commit(pillarjs/router@0b5a0a6) and is listed in the changelog for releasing version 2 of the router (pillarjs/router#60).
Although +1 on bringing it back, it's useful for debugging while we have a new logger.
Directly using DEBUG=express:* node index.js because express no longer directly using the debug package
however we can add internal logs into the middleware for tracking
I swear I had written a reply to this, sorry I must have accidentally forgotten to hit send, sorry. Maybe was it on the router repo or slack or something? Either way, I from what @bjohansebas showed it was done on purpose, I just wish we knew more than what the router repo shows.
In the long run I would very much like to remove this dependency and use a proper logger (pino) by default. This has a bunch of benefits, but mainly unifying the app logging and framework logging lets authors have consistent formatting and log handling.
So, for today since the change landed nearly 4 years ago and folks are just now noticing, lets not make a hasty decision? We can for sure add this to the "fix before latest" release, but I think we should see if we could easily land a logger integration, since that would be long term better anyway.
The least friction thing to do may be to restore debug in the lib. And follow on later with a holistic removal/replace for express and deps, which would need to land in v6.
edit: and maybe in v5, add deprecation warnings for people who rely on the debug namespaces. could perhaps add an abstraction layer as well, which could go in either v5 or v6
Yep, I agree (no one is coming for you 😄). I looked at it a bit, and the surface area for this change is too large to realistically try and land now. I just wish we knew more about what the reason was (if it was in fact my original asks, or something else).
I feel a deprecation notice should land separately though, once there's more finality to the desired direction for express+deps. I'm happy to work on it when the time comes but it likely warrants more discussion.
Activity
jonchurch commentedon Jan 17, 2025
express:applicationscope debugging is coming through fine.But notably
express:routeris not coming through. In v5 router was moved out into another package, seems to have dropped the debug lib. I dont know that the exclusion was on purpose, cc @wesleytoddAn aside, splitting like this makes it more difficult to debug router under the
express:*namespace. Not impossible, but something to solve for.UlisesGascon commentedon Jan 17, 2025
+1 AFAIK this was not an intended move. I will consider this as a bug and one of the reason to not tag express@5 as
latestin npmbjohansebas commentedon Jan 17, 2025
This doesn't seem to be a bug, it was done in this commit(pillarjs/router@0b5a0a6) and is listed in the changelog for releasing version 2 of the router (pillarjs/router#60).
Although +1 on bringing it back, it's useful for debugging while we have a new logger.
azadsingh99 commentedon Jan 19, 2025
Directly using DEBUG=express:* node index.js because express no longer directly using the debug package
however we can add internal logs into the middleware for tracking
wesleytodd commentedon Jan 20, 2025
I swear I had written a reply to this, sorry I must have accidentally forgotten to hit send, sorry. Maybe was it on the router repo or slack or something? Either way, I from what @bjohansebas showed it was done on purpose, I just wish we knew more than what the
routerrepo shows.In the long run I would very much like to remove this dependency and use a proper logger (
pino) by default. This has a bunch of benefits, but mainly unifying the app logging and framework logging lets authors have consistent formatting and log handling.So, for today since the change landed nearly 4 years ago and folks are just now noticing, lets not make a hasty decision? We can for sure add this to the "fix before latest" release, but I think we should see if we could easily land a logger integration, since that would be long term better anyway.
krzysdz commentedon Jan 20, 2025
There was a discussion about removing
debuginrouterin 2017: pillarjs/router#57ctcpip commentedon Feb 14, 2025
Don't come for me, but... 😅
The least friction thing to do may be to restore debug in the lib. And follow on later with a holistic removal/replace for express and deps, which would need to land in v6.
edit: and maybe in v5, add deprecation warnings for people who rely on the debug namespaces. could perhaps add an abstraction layer as well, which could go in either v5 or v6
UlisesGascon commentedon Feb 15, 2025
I agree with @ctcpip proposal: restore + deprecation warning
wesleytodd commentedon Feb 15, 2025
Yep, I agree (no one is coming for you 😄). I looked at it a bit, and the surface area for this change is too large to realistically try and land now. I just wish we knew more about what the reason was (if it was in fact my original asks, or something else).
dpopp07 commentedon Feb 17, 2025
I can open a PR to restore
debuginrouter.I feel a deprecation notice should land separately though, once there's more finality to the desired direction for express+deps. I'm happy to work on it when the time comes but it likely warrants more discussion.
dpopp07 commentedon Feb 18, 2025
Opened pillarjs/router#151 - any feedback is welcome
bjohansebas commentedon Feb 19, 2025
This has already been discussed, so I will remove it from the agenda. The conversation can continue in the PR.
wesleytodd commentedon Mar 5, 2025
The PR is merged in
routerand a docs update PR is open. I am going to close this as it will go out with5.1.0.