Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. Play framework - 2.5
  2.  
  3. kamon-core - 0.6.2
  4.  
  5. kamon-play-25 - 0.6.2
  6.  
  7. <pattern>%d{HH:mm:ss.SSS} [%thread] [%level] [%traceToken]- %logger{36}(%L) %X{X-ApplicationId} - %message%n%xException</pattern>
  8.  
  9. class AccessLoggingFilter @Inject() (implicit val mat: Materializer, ec: ExecutionContext) extends Filter with LazyLogging {
  10. val ApplicationIdKey = AvailableToMdc("X-ApplicationId")
  11. def apply(next: (RequestHeader) => Future[Result])(request: RequestHeader): Future[Result] = {
  12. TraceLocal.storeForMdc("X-ApplicationId", request.id.toString)
  13. logger.error("first Location")
  14. withMdc {
  15. logger.error("Second location")
  16. next(request)
  17. }}}
  18.  
  19. class MyFilters @Inject() (accessLoggingFilter: AccessLoggingFilter) extends DefaultHttpFilters(accessLoggingFilter)
  20.  
  21. c.v.i.utils.AccessLoggingFilter(24) - first Location
  22. c.v.i.utils.AccessLoggingFilter(26) 1 - Second location
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement