Mybatis 로그 설정

2024. 12. 28. 21:28Java/mybatis

logback
/resourcs/logback-spring.xml

<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="org.mybatis" level="DEBUG" additivity="false">
        <appender-ref ref="STDOUT" />
    </logger>
    <logger name="org.apache.ibatis" level="DEBUG" additivity="false">
        <appender-ref ref="STDOUT" />
    </logger>

    <root level="INFO">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>

Spring boot

application.properties

logging.level.org.mybatis=DEBUG
logging.level.org.apache.ibatis=DEBUG
logging.level.java.sql.PreparedStatement=DEBUG
logging.level.java.sql.Statement=DEBUG
logging.level.java.sql.ResultSet=DEBUG

application.yml

logging:
	level:
    	org:
        	mybatis: DEBUG

logging:
	level:
		'[org.mybatis]': DEBUG

'Java > mybatis' 카테고리의 다른 글

Mybatis insert후 키값 반환하기  (0) 2024.12.27
Mybatis if ~ else 적용하기  (0) 2024.11.27
mybatis ORA-00979: GROUP BY 표현식이 아닙니다  (0) 2024.11.26
mybatis를 이용해서 BLOB 저장  (1) 2024.11.07
IN() 절 처리  (0) 2024.11.07