Express & Koa middlewares and Fastify & Hapi plugins for CLS-based request ID generation, batteries included. An out-of-the-box solution for adding request IDs into your logs. Check out this blog post that describes the rationale behind cls-rtracer. Automatically generates a UUID V1 value as the id for each request and stores it in AsyncLocalStorage. Optionally, if the request contains an X-Request-Id header, uses its value instead. Allows to obtain the generated request id anywhere in your routes later and use it for logging or any other purposes.

Features

  • Tested and works fine with Express v4, Fastify v2 and v3, Koa v1 and v2, and Hapi v18
  • Use the middleware (or plugin) provided by the library before the first middleware that needs to have access to request IDs
  • Legacy Fastify middleware
  • Use the plugin provided by the library
  • Integration with loggers
  • Licensed under MIT
  • Documentation available

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow cls-rtracer

cls-rtracer Web Site

Other Useful Business Software
$300 Free Credits for Your Google Cloud Projects Icon
$300 Free Credits for Your Google Cloud Projects

Start building on Google Cloud with $300 in free credits. No commitment, no credit card required until you're ready to scale.

Launch your next project with $300 in free Google Cloud credits—no strings attached. Test, build, and deploy without risk. Use your credits across the entire Google Cloud platform to find what works best for your needs. After your credits are used, continue with always-free tier services. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of cls-rtracer!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Frameworks

Registered

2024-01-10