Example usage for org.apache.commons.logging Log trace

List of usage examples for org.apache.commons.logging Log trace

Introduction

In this page you can find the example usage for org.apache.commons.logging Log trace.

Prototype

void trace(Object message, Throwable t);

Source Link

Document

Logs an error with trace log level.

Usage

From source file:net.lightbody.bmp.proxy.jetty.util.LogSupport.java

/**
 * Ignore an exception unless trace is enabled.
 * This works around the problem that log4j does not support the trace level.
 *//*from w w w .  ja  v a 2  s.c  o  m*/
public static void ignore(Log log, Throwable th) {
    if (log.isTraceEnabled())
        log.trace(IGNORED, th);
}

From source file:com.buffalokiwi.api.APILog.java

/**
 * Log an error with trace log level.//from   www  .  java2 s. c om
 *
 * @param log Log to write to
 * @param message log this message
 * @param t log this cause
 */
public static void trace(final Log log, final Throwable t, final Object... message) {
    if (log.isTraceEnabled())
        log.trace(concat(message), t);
}

From source file:net.gleamynode.netty2.SessionLog.java

public static void trace(Log log, Session session, Object obj, Throwable cause) {
    log.trace(getMessage(session, obj), cause);
}

From source file:es.tunelator.log.Logger.java

/**
 * @param source/*from   w  w w . j a  v  a 2  s . c  o  m*/
 * @param msg
 * @param e
 */
public static void logTrace(Class source, String msg, Throwable e) {
    Log log = LogFactory.getLog(source);
    log.trace(msg, e);
}

From source file:com.headissue.pigeon.util.LogUtils.java

public static void trace(Log log, Throwable t, String message, Object... args) {
    if (log.isTraceEnabled()) {
        if (args != null && args.length > 0) {
            message = String.format(message, args);
        }//w ww.jav a2s.co m
        log.trace(message, t);
    }
}

From source file:com.runwaysdk.logging.RunwayLogUtil.java

public static void logToLevel(Log log, LogLevel level, String msg, Throwable t) {
    if (level == LogLevel.TRACE) {
        log.trace(msg, t);
    } else if (level == LogLevel.DEBUG) {
        log.debug(msg, t);//from w  w  w  .  j  a  v a2s  .  c om
    } else if (level == LogLevel.INFO) {
        log.info(msg, t);
    } else if (level == LogLevel.WARN) {
        log.warn(msg, t);
    } else if (level == LogLevel.ERROR) {
        log.error(msg, t);
    } else if (level == LogLevel.FATAL) {
        log.fatal(msg, t);
    } else {
        log.fatal(
                "RunwayLogUtil.logToLevel was called, but an invalid level was specified. Here is the message we were passed: '"
                        + msg + "'");
    }
}

From source file:hadoopInstaller.logging.CompositeLog.java

@Override
public void trace(Object message, Throwable t) {
    for (Log log : this.logs) {
        log.trace(message, t);
    }//  ww w  .java2 s . c  om
}

From source file:io.netty.logging.CommonsLoggerTest.java

@Test
public void testTraceWithException() {
    Log mock = createStrictMock(Log.class);

    mock.trace("a", e);
    replay(mock);//w  w w  .ja v a2 s.co m

    InternalLogger logger = new CommonsLogger(mock, "foo");
    logger.trace("a", e);
    verify(mock);
}

From source file:fr.gouv.vitam.utils.logging.CommonsLoggerTest.java

@Test
public void testTraceWithException() {
    final Log mock = createStrictMock(Log.class);

    mock.trace("a", e);
    replay(mock);/*w ww .j  av a 2  s .c o  m*/

    final VitamLogger logger = new CommonsLogger(mock, "foo");
    logger.trace("a", e);
    verify(mock);
}

From source file:com.sos.i18n.logging.commons.CommonsLogMsg.java

/**
 * Logs the message, along with the given <code>throwable</code>, at the trace level. If
 * {@link Logger#getDumpStackTraces() stack traces are not to be dumped}, the logged message will be appended
 * with the throwable's <code>Throwable.toString()</code> contents.
 *
 * @param log       where to log the message
 * @param key       the resource key that is associated with the message
 * @param msg       the message to log/*w ww. j  a v a  2s  .  c om*/
 * @param throwable the throwable associated with the message
 */
private static void logTraceWithThrowable(Log log, String key, Msg msg, Throwable throwable) {
    if (Logger.getDumpStackTraces()) {
        log.trace(((Logger.getDumpLogKeys()) ? ('{' + key + '}' + msg) : msg), throwable);
    } else {
        log.trace(((Logger.getDumpLogKeys()) ? ('{' + key + '}' + msg) : msg) + ". Cause: "
                + throwable.toString());
    }
}