@Override public void finish() { propertyPathStack.pop(); MDC.remove( MDC_KEY ); fetchSourceStack.clear(); }
public Object processInvocation(final InterceptorContext context) throws Exception { final Map<String, Object> mdc = MDC.getMap(); if (mdc != null) { for (String str : mdc.keySet()) { MDC.remove(str); } } final StoredLogDiagnosticContext data = (StoredLogDiagnosticContext) context.getPrivateData(KEY); context.putPrivateData(KEY, null); if (data != null && data.getMdc() != null) { for (Map.Entry<String, Object> entry : data.getMdc().entrySet()) { MDC.put(entry.getKey(), entry.getValue()); } final int depth = NDC.getDepth(); NDC.push(data.getNdc()); try { return context.proceed(); } finally { NDC.setMaxDepth(depth); for (String str : MDC.getMap().keySet()) { MDC.remove(str); } } } return context.proceed(); } }
@Override public void removeMdc(String key) { MDC.remove(key); }
public void remove(String key) { MDC.remove(key); }
@Override public void putMdc(String key, String val) { if (val == null) { MDC.remove(key); } else { MDC.put(key, val); } }
/** * {@inheritDoc} */ @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { MDC.put("username", authentication.getPrincipal()); } filterChain.doFilter(servletRequest, servletResponse); MDC.remove("username"); }
/** * {@inheritDoc} */ @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { MDC.put("username", authentication.getPrincipal()); } filterChain.doFilter(servletRequest, servletResponse); MDC.remove("username"); }
public void clear() { MDC.remove( MDC_KEY ); if ( !internalStack.isEmpty() ) { log.debug( "NavigablePathStack not empty upon completion of visitation; mis-matched push/pop?" ); internalStack.clear(); } } }