From 3972a77c8524402c8d71cd5916c106778eeb2027 Mon Sep 17 00:00:00 2001 From: sohot8653 Date: Tue, 2 Sep 2025 11:03:50 +0900 Subject: [PATCH] =?UTF-8?q?[P6Spy=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8]?= =?UTF-8?q?=20P6Spy=20Spring=20Boot=20Starter=20=EB=B2=84=EC=A0=84?= =?UTF-8?q?=EC=9D=84=201.12.0=EC=9C=BC=EB=A1=9C=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=ED=95=98=EA=B3=A0,=20SQL=20=EB=A1=9C?= =?UTF-8?q?=EA=B9=85=20=ED=8F=AC=EB=A7=B7=20=EC=84=A4=EC=A0=95=EC=9D=84=20?= =?UTF-8?q?spy.properties=20=ED=8C=8C=EC=9D=BC=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=ED=95=98=EC=97=AC=20=EA=B8=B0=EB=B3=B8=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=A8.=20application?= =?UTF-8?q?.properties=EC=97=90=EC=84=9C=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=84=A4=EC=A0=95=20=EC=A0=9C=EA=B1=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- src/main/resources/application.properties | 1 - src/main/resources/spy.properties | 12 ++++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/spy.properties 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