0

I am developing an application in Vertx. I am attaching uniqueRequestId to each request and adds it to the requestContext object, so that while printing any logs I will associate uniqueRequestId to each log message and I will be able to better trace the request logs.

Now the one approach to this is, I can pass requestContext object to each function.

So my question is that, Is there any way to access requestContext object without passing it to each and every function?

Ivan Kaloyanov
  • 1,748
  • 6
  • 18
  • 24
Vaibhav Raut
  • 472
  • 3
  • 12

1 Answers1

2

You could use the contextual logging for Vert.x 4 (disclaimer: I created this library).

With Vert.x 3 you can only do it manually.

tsegismont
  • 8,591
  • 1
  • 17
  • 27