-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
req.route.path value is undefined #270
Comments
@ryhinchey @dougwilson Kindly check |
@brijeshshah13 I believe the request object is passed down from earlier middleware. The existence of |
@brijeshshah13 are you able to resolve issue? if not can you share you server.js file where you calling logger middleware |
Description
I'm using morgan logger version 1.9.1 in a service and I'm using custom format function as mentioned in their instructions. In the custom format function, I'm accessing
req.route.path
as shown in the code below:The issue is that out of all the requests that I receive on the server, for some of them I get
req.route
asundefined
due to which I don't get the value ofpath
. Likewise, for some requests, probably the same ones, I get values of variablesresponseTimeInMS
&statusCode
asundefined
. I'm not sure what the issue can be here. Any help is appreciated.The text was updated successfully, but these errors were encountered: