mirror of https://github.com/usbharu/Hideout.git
revert: MDCに対応してなかったので削除
This commit is contained in:
parent
0c9faa509b
commit
eed5e8a75a
|
@ -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")
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@
|
||||||
<Configuration status="WARN">
|
<Configuration status="WARN">
|
||||||
<Appenders>
|
<Appenders>
|
||||||
<Console name="Console" target="SYSTEM_OUT">
|
<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>
|
</Console>
|
||||||
</Appenders>
|
</Appenders>
|
||||||
<Loggers>
|
<Loggers>
|
||||||
|
|
Loading…
Reference in New Issue