trace - generic tracing for koa

  •        0

A generic tracing module.Use `.trace()` calls in your middlewareand send all the data to your favorite tracer or stats aggregatorlike jstrace, dtrace, ktap, statds, etc.[debug](http://github.com/visionmedia/debug) also supported!```jsapp.use(function* (next) { // give each request some sort of ID this.id = crypto.randomBytes(12) // log events with optional arguments this.trace('start') yield* next this.trace('finish')})```Enable [debug](http://github.com/visionmedia/debug) usage:```jsapp.debug()```Now run your app with `DEBUG=koa-trace:*` and watch the events unfold:![debug statements](assets/debug.png)You can see the debug statements grouped by request ID.Then the event is shown, the time difference since the last statement,and the arguments passed to `.trace()`.

https://github.com/koajs/trace

Tags
Implementation
License
Platform

   




Related Projects