Java slf4j Logger logResult(long time, String traceId, String apiName, String params, String jsonObject)

Here you can find the source of logResult(long time, String traceId, String apiName, String params, String jsonObject)

Description

log Result

License

Apache License

Parameter

Parameter Description
traceId a parameter
apiName a parameter
params a parameter

Declaration

public static void logResult(long time, String traceId, String apiName,
        String params, String jsonObject) 

Method Source Code

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

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {
    private static final String LOG_TRACE_MSG_WITH_PARAMS_DEBUG = "time={},id={},service={},params={},result={}";
    private static final String LOG_TRACE_MSG_WITH_PARAMS_INFO = "time={},id={},service={}";
    private static Logger REUEST_LOGGER = LoggerFactory
            .getLogger("venus.tracer");

    /**/*from   www. j a  v  a 2  s  .c o  m*/
     * 
     * @param traceId
     * @param apiName
     * @param params
     */
    public static void logResult(long time, String traceId, String apiName,
            String params, String jsonObject) {
        if (REUEST_LOGGER.isDebugEnabled()) {
            REUEST_LOGGER.debug(LOG_TRACE_MSG_WITH_PARAMS_DEBUG,
                    new Object[] { time, traceId, apiName, params,
                            jsonObject });
        } else if (REUEST_LOGGER.isInfoEnabled()) {
            REUEST_LOGGER.info(LOG_TRACE_MSG_WITH_PARAMS_INFO,
                    new Object[] { time, traceId, apiName });
        }
    }
}

Related

  1. logInfo(Logger log)
  2. logInfo(Logger log, Throwable t)
  3. logInfo(Logger logger, String s)
  4. logJavaProperties(Logger log)
  5. logLine(final Logger logger, final Level level, final String msg, final boolean withStackTrace, final String logMessagePrefix)
  6. logThreadGroup(final Logger log, ThreadGroup group, int level)
  7. logThrowable(Throwable throwable)
  8. logWarningWithDebugDetails(Logger logger, Throwable t, String message, Object... values)
  9. notNull(String message, Object obj)