Java slf4j Logger printRequestLog(Map reqParam)

Here you can find the source of printRequestLog(Map reqParam)

Description

print Request Log

License

Open Source License

Declaration

public static void printRequestLog(Map<String, String> reqParam) 

Method Source Code

//package com.java2s;
/**//from w w w . ja  v a2  s  . c  o  m
 *
 * Licensed Property to China UnionPay Co., Ltd.
 * 
 * (C) Copyright of China UnionPay Co., Ltd. 2010
 *     All Rights Reserved.
 *
 * 
 * Modification History:
 * =============================================================================
 *   Author         Date          Description
 *   ------------ ---------- ---------------------------------------------------
 *   xshu       2014-05-28       ?????????
 * =============================================================================
 */

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

public class Main {
    private final static Logger GATELOG_MESSAGE = LoggerFactory.getLogger("SDK_MSG_LOG");
    final static String LOG_STRING_REQ_MSG_BEGIN = "============================== SDK REQ MSG BEGIN ==============================";
    final static String LOG_STRING_REQ_MSG_END = "==============================  SDK REQ MSG END  ==============================";

    public static void printRequestLog(Map<String, String> reqParam) {
        writeMessage(LOG_STRING_REQ_MSG_BEGIN);
        Iterator<Entry<String, String>> it = reqParam.entrySet().iterator();
        while (it.hasNext()) {
            Entry<String, String> en = it.next();
            writeMessage("[" + en.getKey() + "] = [" + en.getValue() + "]");
        }
        writeMessage(LOG_STRING_REQ_MSG_END);
    }

    public static void writeMessage(String msg) {
        GATELOG_MESSAGE.info(msg);
    }
}

Related

  1. logWarningWithDebugDetails(Logger logger, Throwable t, String message, Object... values)
  2. notNull(String message, Object obj)
  3. parsePortNumber(String port, int defaultPort)
  4. printInfoLog(Class cla, String message)
  5. printPrettyJson(Logger logger, String json)
  6. printResponseLog(String res)
  7. printStackTrace(Logger logger, Throwable e)
  8. profilerTrigger2(Logger log, String msg)
  9. putMDCs(String clientId, String subjectId)