반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- centos
- 리눅스
- 개발
- VirtualBox
- localserver
- Android
- ReactNative
- xcode
- 티스토리챌린지
- webpack
- jest
- react
- androidstudio
- TensorFlow
- node
- 네트워크
- MAC
- 맥
- 센토스
- unittest
- linux
- 오블완
- MachineLearning
- build
- PYTHON
- vsCode
- IOS
- Chrome
- qunit
Archives
- Today
- Total
로메오의 블로그
spring boot 쿼리 로그 설정 - 파라미터 표시되게 본문
반응형
Spring Boot / Oracle / Mybatis 차례
pom.xml 수정
<!-- 파라메터 포함 쿼리 로그 -->
<dependency>
<groupId>org.lazyluke</groupId>
<artifactId>log4jdbc-remix</artifactId>
<version>0.2.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<!-- 파라메터 포함 쿼리 로그 -->
dependency를 추가합니다.
context-datasource.xml
<bean id="dataSource" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
<constructor-arg ref="dataSourceSpied" />
</bean>
<bean id="dataSourceSpied" class="${Globals.db.class}">
<property name="driverClassName" value="${Globals.db.DriverClassName}" />
<property name="url" value="${Globals.db.Url}" />
<property name="username" value="${Globals.db.UserName}" />
<property name="password" value="${Globals.db.Password}" />
</bean>
dataSource bean를 변경하고, dataSourceSpied bean를 추가합니다.
log4j2.xml 수정
<Logger name="jdbc.sqltiming" level="OFF" additivity="false">
<AppenderRef ref="console" />
</Logger>
level을 OFF로 변경합니다.
반응형
'Backend > Spring' 카테고리의 다른 글
이클립스 단축키 (2) | 2023.01.04 |
---|---|
[Spring] IN 조건문을 위한 foreach 사용하기 - myBatis, sql (0) | 2019.12.20 |
[Spring Boot] 파일 업로드 처리 - ajax file upload (0) | 2019.12.11 |
[Spring Boot] myBatis Procedure / function 호출 (0) | 2019.12.04 |
[Spring boot] 예외처리 - GlobalExceptionHandler - ControllerAdvice (0) | 2019.10.15 |
Comments