일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- Java
- loadcomplete
- 서브라임 텍스트
- Spring Boot
- tortoise SVN
- exit code = -805306369
- HTML Special Entity
- NestJS
- HTML Code
- tomcat
- typeorm
- NextJs
- MariaDB
- Maven Project
- Eclipse
- Windows 10
- STS
- Next.js
- springboot
- Spring Cloud
- Spring
- PostgreSQL
- JSP
- maven
- Can't load AMD 64-bit .dll on a IA 32-bit platform
- BRIN
- PG-Strom
- OGM
- graph database
- orioledb
- Today
- Total
Undergoing
springboot에 slf4j 설정 시 느릴 경우 본문
한 50개 넘어가는 데이터를 단순 select 하는데도 이클립스가 뻗어버려서 보니까 다른 설정을 안 넣어줬었다.
그래서 찾아보니 logback 설정이 누락되어 있어서 발생한 문제. filter가 하나도 없어서 있는 그대로 로그를 긁어오다 보니 이클립스가 뻗어버린 것이다. 없어도 소규모 데이터는 가져오길래 생각도 못했징..
pom.xml
<!-- set log4jdbc --> <dependency> <groupId>org.bgee.log4jdbc-log4j2</groupId> <artifactId>log4jdbc-log4j2-jdbc4.1</artifactId> <version>${log4jdbc-log4j2-jdbc4.1-version}</version> </dependency> <dependency> <groupId>org.logback-extensions</groupId> <artifactId>logback-ext-spring</artifactId> <version>${logback-ext-spring-version}</version> </dependency> |
logback-spring.xml
<?xml version="1.0" encoding="UTF-8"?> <configuration> <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"> <resetJUL>true</resetJUL> </contextListener>
<property name="pattern_layout" value="%d{yyyy-MM-d'T'HH:mm:ss.SSS}|%-5level|%-40logger{40}:%line|%msg%n" />
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>${pattern_layout}</pattern> </layout> </appender>
<include resource="logback/${spring.profiles.active}.xml"/> </configuration> |
prod.xml
<?xml version="1.0" encoding="UTF-8"?> <included> <!-- jdbc.sqlonly : Logs only SQL jdbc.sqltiming : Logs the SQL, post-execution, including timing execution statistics jdbc.audit : Logs ALL JDBC calls except for ResultSets jdbc.resultset : all calls to ResultSet objects are logged jdbc.connection : Logs connection open and close events --> <appender name="service_rolling" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${LOG_DIR}/service.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <FileNamePattern>${LOG_DIR}/%d{yyyyMM, aux}/service_%d{yyyyMMdd}.%i.log</FileNamePattern> <maxFileSize>20MB</maxFileSize> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>${pattern_layout}</pattern> </layout> </appender>
<appender name="error_rolling" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${LOG_DIR}/error.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <FileNamePattern>${LOG_DIR}/%d{yyyyMM, aux}/error_%d{yyyyMMdd}.%i.log</FileNamePattern> <maxFileSize>20MB</maxFileSize> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>${pattern_layout}</pattern> </layout> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>ERROR</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY</onMismatch> </filter> </appender>
<appender name="service_rolling_async" class="ch.qos.logback.classic.AsyncAppender"> <appender-ref ref="service_rolling" /> </appender> <appender name="error_rolling_async" class="ch.qos.logback.classic.AsyncAppender"> <appender-ref ref="error_rolling" /> </appender>
<logger name="jdbc" level="OFF"/>
<logger name="jdbc.sqlonly" level="DEBUG" additivity="false"> <appender-ref ref="console" /> </logger>
<logger name="jdbc.resultsettable" level="DEBUG" additivity="false"> <appender-ref ref="console" /> </logger>
<logger name="package name" additivity="false"> <level value="debug" /> <appender-ref ref="console" /> </logger>
<!-- root --> <root> <level value="info" /> <appender-ref ref="console" /> <appender-ref ref="service_rolling" /> <appender-ref ref="error_rolling" /> </root> </included> |
안 잊어버리게 메모 메모.
'개발 > DB' 카테고리의 다른 글
PostgreSQL - GiST (0) | 2021.12.08 |
---|---|
PostgreSQL - GIN (0) | 2021.12.06 |
PostgreSQL - BRIN (0) | 2021.11.30 |
OGM(Object Gpath Mapper) (0) | 2021.08.30 |
[MariaDB] CSV 파일 import (0) | 2017.09.08 |