Java slf4j Logger stopTestLogging()

Here you can find the source of stopTestLogging()

Description

Removes the key (log file name) from MDC

License

Apache License

Return

name of the log file, if one existed in MDC

Declaration

public static String stopTestLogging() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.slf4j.MDC;

public class Main {
    public static final String TEST_NAME = "test-name";

    /**/*  www  . j a  v  a2  s.  c om*/
     * Removes the key (log file name) from MDC
     * @return name of the log file, if one existed in MDC
     */
    public static String stopTestLogging() {
        String name = MDC.get(TEST_NAME);
        MDC.remove(TEST_NAME);
        return name;
    }
}

Related

  1. setRequestId(String requestId)
  2. sleep(int milliseconds)
  3. sleepMs(Logger logger, long timeMs)
  4. stacktrace(Logger log, Throwable t)
  5. startTestLogging(String name)
  6. stringifyStackTrace(Exception e)
  7. testLogError(String errorMessage, Exception ex)
  8. traceCall(Class objectClass)
  9. traceLog(final Logger log, final String logMethodName, String logMsg)