2018-01-09 09:52:14,100 [INFO ] [play-dev-mode-akka.actor.default-dispatcher-6] [requestId=+tFe6IIoQyiMt4YYfT1MmQ] c.e.n.p.s.c.HttpContextFilter:27 Hello HttpContextFilter2018-01-09 09:52:14,102 [INFO ] [application-akka.actor.default-dispatcher-2] [requestId=+tFe6IIoQyiMt4YYfT1MmQ] c.e.n.p.s.c.AccessLogFilter:76 0:0:0:0:0:0:0:1
2018-01-09 09:54:55,343 [INFO ] [application-akka.actor.default-dispatcher-2] [requestId=z699KLkFQLG7BbTKoX+BGg] c.e.n.p.s.c.HttpContextFilter:27 Hello HttpContextFilter2018-01-09 09:54:55,346 [INFO ] [application-akka.actor.default-dispatcher-9] [] c.e.n.p.s.c.AccessLogFilter:76 0:0:0:0:0:0:0:1
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/efa535a7-fa60-4452-ad85-f5038b762027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm not sure exactly why your solution isn't working. You are using the deprecated ExecutionContext#prepare method, but it's hard to tell if that's not the actual problem. What are you doing in your AccessLogFilter?
On Tue, Jan 9, 2018 at 10:19 AM, Jeff White <jsw...@ebay.com> wrote:
I have been using a combination of an MDC-propagating ExecutionContext and a Play filter to assign a requestId to every incoming request and have it included in every log statement by logback. This stopped working upon updating play 2.6.9 -> 2.6.10. I suspect it may be related to these changesExample 2.6.9 logs
2018-01-09 09:52:14,100 [INFO ] [play-dev-mode-akka.actor.default-dispatcher-6] [requestId=+tFe6IIoQyiMt4YYfT1MmQ] c.e.n.p.s.c.HttpContextFilter:27 Hello HttpContextFilter2018-01-09 09:52:14,102 [INFO ] [application-akka.actor.default-dispatcher-2] [requestId=+tFe6IIoQyiMt4YYfT1MmQ] c.e.n.p.s.c.AccessLogFilter:76 0:0:0:0:0:0:0:1Example 2.6.10 logs (note missing requestId in the 2nd statement)
2018-01-09 09:54:55,343 [INFO ] [application-akka.actor.default-dispatcher-2] [requestId=z699KLkFQLG7BbTKoX+BGg] c.e.n.p.s.c.HttpContextFilter:27 Hello HttpContextFilter2018-01-09 09:54:55,346 [INFO ] [application-akka.actor.default-dispatcher-9] [] c.e.n.p.s.c.AccessLogFilter:76 0:0:0:0:0:0:0:1Details of the MDC propagation setupLet me know if I should move this to a github issuethanksjeff
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/efa535a7-fa60-4452-ad85-f5038b762027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAA%3D11HxQ%2BV-mHPi3U_ww0n-KoiuphA%2BZwTJiHqoXN7kkRteuQA%40mail.gmail.com.
I don't know if it helps but we're using the solution described in http://yanns.github.io/blog/2014/05/04/slf4j-mapped-diagnostic-context-mdc-with-play-framework/ to correlate requests via some kind of identifier which can be used for logging.We don't encounter any issues after upgrading to 2.6.10.
Greg Methvin <gr...@lightbend.com> schrieb am Mi., 10. Jan. 2018 um 09:52 Uhr:
I'm not sure exactly why your solution isn't working. You are using the deprecated ExecutionContext#prepare method, but it's hard to tell if that's not the actual problem. What are you doing in your AccessLogFilter?
On Tue, Jan 9, 2018 at 10:19 AM, Jeff White <jsw...@ebay.com> wrote:
I have been using a combination of an MDC-propagating ExecutionContext and a Play filter to assign a requestId to every incoming request and have it included in every log statement by logback. This stopped working upon updating play 2.6.9 -> 2.6.10. I suspect it may be related to these changesExample 2.6.9 logs
2018-01-09 09:52:14,100 [INFO ] [play-dev-mode-akka.actor.default-dispatcher-6] [requestId=+tFe6IIoQyiMt4YYfT1MmQ] c.e.n.p.s.c.HttpContextFilter:27 Hello HttpContextFilter2018-01-09 09:52:14,102 [INFO ] [application-akka.actor.default-dispatcher-2] [requestId=+tFe6IIoQyiMt4YYfT1MmQ] c.e.n.p.s.c.AccessLogFilter:76 0:0:0:0:0:0:0:1Example 2.6.10 logs (note missing requestId in the 2nd statement)
2018-01-09 09:54:55,343 [INFO ] [application-akka.actor.default-dispatcher-2] [requestId=z699KLkFQLG7BbTKoX+BGg] c.e.n.p.s.c.HttpContextFilter:27 Hello HttpContextFilter2018-01-09 09:54:55,346 [INFO ] [application-akka.actor.default-dispatcher-9] [] c.e.n.p.s.c.AccessLogFilter:76 0:0:0:0:0:0:0:1Details of the MDC propagation setupLet me know if I should move this to a github issuethanksjeff
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/efa535a7-fa60-4452-ad85-f5038b762027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
----
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAA%3D11HxQ%2BV-mHPi3U_ww0n-KoiuphA%2BZwTJiHqoXN7kkRteuQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAOf-V-ymN%2B7nb2Htp%3Dxc1YvBXYrHgL_mF58DSthujExa9TOAxQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/efa535a7-fa60-4452-ad85-f5038b762027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
----
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAA%3D11HxQ%2BV-mHPi3U_ww0n-KoiuphA%2BZwTJiHqoXN7kkRteuQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAOf-V-ymN%2B7nb2Htp%3Dxc1YvBXYrHgL_mF58DSthujExa9TOAxQ%40mail.gmail.com.
To add more context: my solution (details here) is originally based on that same blog post by Yann Simon (solution 1: custom Akka dispatcher) and has evolved with help from Yann's comment in this related Github issue I opened June 2017. The current solution has worked all the way up to play 2.6.9.Yes, it uses ExecutionContext.prepare(), which is deprecated, however not removed and no plan for replacement.
Will the 2nd solution in the blog post work? I'm not sure if it's possible to direct Play internals to use a custom EC, compared to the first solution of configuring the Akka dispatcher.
Greg: The AccessLogFilter just logs standard request details and timing info after the request is handled. If the MDC is present in the log statement, then it demonstrates the MDC was successfully propagated all the way to the end.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/cffa7a52-cef3-4b1f-a91c-2780e5f42134%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/cffa7a52-cef3-4b1f-a91c-2780e5f42134%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAA%3D11HwCQcfs4bT6DDOoTWhqt87rJXSvyRuxLCWHQ4wEm%2BYvYQ%40mail.gmail.com.
On Wed, Jan 10, 2018 at 3:42 PM, Jeff White <jsw...@ebay.com> wrote:To add more context: my solution (details here) is originally based on that same blog post by Yann Simon (solution 1: custom Akka dispatcher) and has evolved with help from Yann's comment in this related Github issue I opened June 2017. The current solution has worked all the way up to play 2.6.9.Yes, it uses ExecutionContext.prepare(), which is deprecated, however not removed and no plan for replacement.Yes, but it's no longer supposed to be called. Though the standard library does call it, there's no guarantee that other libraries will, and it would now be incorrect for them to do so. I have no idea if that's why it's not working, though. Just pointing out that using prepare might not work going forward.
Will the 2nd solution in the blog post work? I'm not sure if it's possible to direct Play internals to use a custom EC, compared to the first solution of configuring the Akka dispatcher.I think it should work. In general, your top-level EssentialAction (with filters) is executed once in the Play default execution context, and the only other significant "internal" place is in the ActionBuilder, which is customizable. You could override Action in BaseController to use your custom execution context, or just use a different action builder. Everywhere else a context switch occurs, you should have control over the ExecutionContext being passed.
Greg: The AccessLogFilter just logs standard request details and timing info after the request is handled. If the MDC is present in the log statement, then it demonstrates the MDC was successfully propagated all the way to the end.So it's just an EssentialAction, with nothing being executed in a separate ExecutionContext?
Also are you using Netty or Akka HTTP? Does it make a difference which server you use?
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/cffa7a52-cef3-4b1f-a91c-2780e5f42134%40googlegroups.com.