Java slf4j Logger logWarningWithDebugDetails(Logger logger, Throwable t, String message, Object... values)

Here you can find the source of logWarningWithDebugDetails(Logger logger, Throwable t, String message, Object... values)

Description

Log a warning message with the corresponding throwable being logged at debug level.

License

Mozilla Public License

Parameter

Parameter Description
logger the logged used to log the message.
t the corresponding throwable.
message the message.
values the values associated with the message.

Declaration

public static void logWarningWithDebugDetails(Logger logger, Throwable t, String message, Object... values) 

Method Source Code

//package com.java2s;
/**/*from   w  ww. j  ava 2  s  . c  om*/
 * Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import org.slf4j.Logger;

public class Main {
    /**
     * Log a warning message with the corresponding throwable being logged at debug level.
     *
     * @param logger  the logged used to log the message.
     * @param t       the corresponding throwable.
     * @param message the message.
     * @param values  the values associated with the message.
     */
    public static void logWarningWithDebugDetails(Logger logger, Throwable t, String message, Object... values) {
        logger.warn(String.format("%s (details at debug level)", message), values);
        logger.debug("Stacktrace of the preceding warning", t);
    }
}

Related

  1. logJavaProperties(Logger log)
  2. logLine(final Logger logger, final Level level, final String msg, final boolean withStackTrace, final String logMessagePrefix)
  3. logResult(long time, String traceId, String apiName, String params, String jsonObject)
  4. logThreadGroup(final Logger log, ThreadGroup group, int level)
  5. logThrowable(Throwable throwable)
  6. notNull(String message, Object obj)
  7. parsePortNumber(String port, int defaultPort)
  8. printInfoLog(Class cla, String message)
  9. printPrettyJson(Logger logger, String json)