private String outputMDCForAllKeys ( Map < String , String > mdcPropertyMap ) { StringBuilder buf = new StringBuilder ( ) ; boolean first = true ; for ( Map . Entry < String , String > entry : mdcPropertyMap . entrySet ( ) ) { if ( first ) { first = false ; } else { buf . append ( ", " ) ; } //format: key0=value0, key1=value1 buf . append ( entry . getKey ( ) ) . append ( ' ' ) . append ( entry . getValue ( ) ) ; } return buf . toString ( ) ; }
if no key is specified return all the values present in the MDC in the format k1 = v1 k2 = v2 ...