====== Log4j MDC ====== * http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html * 로그 관련 컨텍스트 값을 Thread Local로 설정하고 유지하여 로그로 남길 수 있게 해 준다. * 특히, ServletFilter에서 유입된 정보를 MDC에 넣고, 종료시에 clear() 해주는 식으로 사용할 수 있다. public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // MDC 값설정 try{ chain.doFilter(request, response); } finally { MDC.clear(); } }