diff --git a/build.gradle b/build.gradle index e38e158..4d6c488 100644 --- a/build.gradle +++ b/build.gradle @@ -69,7 +69,7 @@ dependencies { annotationProcessor 'jakarta.persistence:jakarta.persistence-api' // p6spy - implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0' + implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.12.0' // SpringDoc OpenAPI (Swagger) implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9' diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index faefe87..56a0bd8 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -86,7 +86,6 @@ logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %m # P6Spy 설정 (SQL 로깅) # ======================================== decorator.datasource.p6spy.enable-logging=true -decorator.datasource.p6spy.log-format=%(sqlSingleLine) # ======================================== # JWT 설정 diff --git a/src/main/resources/spy.properties b/src/main/resources/spy.properties new file mode 100644 index 0000000..4739fb4 --- /dev/null +++ b/src/main/resources/spy.properties @@ -0,0 +1,12 @@ +################################################################## +# P6Spy 기본 설정 +################################################################## +appender=com.p6spy.engine.spy.appender.Slf4JLogger +logMessageFormat=com.p6spy.engine.spy.appender.CustomLineFormat +logLevel=info + +################################################################## +# SQL 포맷 +################################################################## +customLogMessageFormat=%(currentTime) | %(executionTime) ms | %(category) | connection %(connectionId) | %(sqlSingleLine) +excludecategories=info,debug,result,commit,resultset