Tag Archives: 제거

log4j2 에서 특정 문자열이 존재하는 로그의 행(row)을 정규식(regex)로 출력에서 제거하기

By | 6월 30, 2021

<Appenders> <Console name="console" target="SYSTEM_OUT"> … <RegexFilter regex=".*==>\s*(Preparing|Parameters).*" onMatch="DENY" onMismatch="ACCEPT"/> …. </Console> </Appenders> 위 샘플은 org.apache.ibatis.plugin.Intercepts 를 사용하여 parameter bound query log 를 출력시, 기존에 출력해 주던 쿼리 로그가 필요 없어져서 (preparing statement, parameter 등) 해당 부분을 출력에서 제외하는 예제임. <RegexFilter /> 를 하나 더 선언해 봤는데, 처음에 선언한 것만 작동하는 느낌이었음.

[자작] MyBatis EHCache 를 필요에 따라 statement 별로 제거하기

By | 4월 29, 2020

import java.util.List; import org.apache.ibatis.cache.CacheKey; import lombok.extern.slf4j.Slf4j; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; /** * MyBatis EHCache 관련 유틸 클래스 * * – mapperId + statementId 에 대하여 exactly equals 가 아니라 contains 임에 주의 * * @author STEVE */ @Slf4j public class MyBatisCacheUtil { /** * MyBatis 쿼리 캐시 제거 * * @param mapperId (e.g. “com.example.repository.UserRepository”) *… Read More »