0

I'm using twitter util futures in my project.

I want to add logging to trace a request through the components using MDC.

I couldn't find a good way to add that for twitter futures as there is no execution context that runs the callbacks. I couldn't find a way or any library implementation to refer to.

What is the better way to do this?

Thanks, Nag

Patryk Rudnicki
  • 755
  • 1
  • 8
  • 21
Nag
  • 1

1 Answers1

1

If you're using Twitter Futures because you're using Finagle or one of its sub-projects then that provides a Context for making data available across Futures used in a transaction.

hayden.sikh
  • 770
  • 4
  • 7
  • Thanks for the suggestion https://stackoverflow.com/users/2636793/hayden-sikh . We don't use finagle, but the idea seems nice. I can use the Finagle like Context with a custom implementation of the org.slf4j.MDCAdapter to make it work. – Nag Oct 27 '18 at 05:30