revert: MDCに対応してなかったので削除

This commit is contained in:
usbharu 2024-08-24 13:17:25 +09:00
parent 0c9faa509b
commit eed5e8a75a
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
2 changed files with 1 additions and 34 deletions

View File

@ -1,33 +0,0 @@
package dev.usbharu.hideout.core.infrastructure.springframework
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import org.slf4j.MDC
import org.springframework.stereotype.Component
import org.springframework.web.servlet.AsyncHandlerInterceptor
import java.util.*
@Component
class MdcInterceptor() : AsyncHandlerInterceptor {
override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean {
MDC.put("request", UUID.randomUUID().toString())
return true
}
override fun afterConcurrentHandlingStarted(
request: HttpServletRequest,
response: HttpServletResponse,
handler: Any
) {
MDC.remove("request")
}
override fun afterCompletion(
request: HttpServletRequest,
response: HttpServletResponse,
handler: Any,
ex: Exception?
) {
MDC.remove("request")
}
}

View File

@ -2,7 +2,7 @@
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%.15t] %highlight{%-5level} %x %logger{36} - %msg%n"/>
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%.15t] %highlight{%-5level} %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>