Discover how to associate multiple Node.js log entries with a single request using the express-request-id middleware and X-Request-Id header.
- [Instructor] When logging system activity…it's important to be able to relate logging events…with the request that triggered them.…A single request can create any number of log entries…which compounds the problem.…How can we correlate requests in logs?…The process of tracing a single request,…across multiple logs requires a unique identifier…that is generated by each request.…This unique identifier is commonly known as a request ID.…In Express, a request ID can be included…as part of the request object.…
Then, any time a log entry is created,…include that unique identifier.…Why bother to do this?…Here's an example of five log entries that were triggered…by three requests, a user was created,…there's a failed CAPTCHA, a welcome message was sent,…login failed, then succeeded.…While these are all important events…we can't see what happened…as a result of a particular request.…Here's that exact same example,…but this time with unique request IDs.…Instead of having log entries,…that lack cohesion we can see all the log entries…
- Building a troubleshooting mindset
- Why measure performance?
- What's a microservice architecture?
- Managing microservices with PM2
- Effective logging strategies
- Debugging Node.js applications
- Benchmarking performance
- Profiling code execution
- Knowing what to optimize
Skill Level Intermediate
1. Build a Troubleshooting Mindset
2. Introducing Microservices
3. Effective Logging Strategies
4. Debugging Node.js Applications
Debugging isn't just logging3m 51s
5. Measuring Performance
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.