Merge pull request #36 from TouchInstinct/fix/logger-context-update

Fix LoggerExecutionContext update
This commit is contained in:
Mikhail Yasnov 2021-07-19 12:34:21 +03:00 committed by GitHub
commit 8d5719fa1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -33,11 +33,15 @@ class LoggingInterceptor(
val uri = request.requestURI.let(::URI)
LoggerExecutionContext.current.updateContext { context ->
context.plus(DefaultContextFields.id.name to UUID.randomUUID().toString())
context.plus(DefaultContextFields.host.name to uri.host)
context.plus(DefaultContextFields.path.name to uri.path)
context.plus(DefaultContextFields.httpMethod.name to request.method)
context.plus(DefaultContextFields.ipAddress.name to request.publicIp)
context.plus(
mapOf(
DefaultContextFields.id.name to UUID.randomUUID().toString(),
DefaultContextFields.host.name to uri.host,
DefaultContextFields.path.name to uri.path,
DefaultContextFields.httpMethod.name to request.method,
DefaultContextFields.ipAddress.name to request.publicIp,
)
)
}
logBuilderFactory.create(this::class.java)