public void clear() {

        /**
         * Unfortunately log4j's MDC historically never had a mechanism to block remove keys,
         * so we're forced to do this one by one.
         */
        for (String key : allKeys()) {
           mdcBridge.remove(key);
        }

        PER_THREAD_CONTEXTS.getUnchecked(Thread.currentThread()).clear();
    }
public void clear ( ) { for ( String key : allKeys ( ) ) { mdcBridge . remove ( key ) ; } PER_THREAD_CONTEXTS . getUnchecked ( Thread . currentThread ( ) ) . clear ( ) ; }
Clears all values for the current thread.