Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Play framework - 2.5
- kamon-core - 0.6.2
- kamon-play-25 - 0.6.2
- <pattern>%d{HH:mm:ss.SSS} [%thread] [%level] [%traceToken]- %logger{36}(%L) %X{X-ApplicationId} - %message%n%xException</pattern>
- class AccessLoggingFilter @Inject() (implicit val mat: Materializer, ec: ExecutionContext) extends Filter with LazyLogging {
- val ApplicationIdKey = AvailableToMdc("X-ApplicationId")
- def apply(next: (RequestHeader) => Future[Result])(request: RequestHeader): Future[Result] = {
- TraceLocal.storeForMdc("X-ApplicationId", request.id.toString)
- logger.error("first Location")
- withMdc {
- logger.error("Second location")
- next(request)
- }}}
- class MyFilters @Inject() (accessLoggingFilter: AccessLoggingFilter) extends DefaultHttpFilters(accessLoggingFilter)
- c.v.i.utils.AccessLoggingFilter(24) - first Location
- c.v.i.utils.AccessLoggingFilter(26) 1 - Second location
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement