Java Code Examples for org.slf4j.event.Level#TRACE

The following examples show how to use org.slf4j.event.Level#TRACE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Slf4jEventSender.java    From cxf with Apache License 2.0 6 votes vote down vote up
/**
 * Override this to easily change the logging level etc.
 */
protected void performLogging(Logger log, Marker marker, String logMessage) {
    if (loggingLevel == Level.INFO) {
        log.info(marker, logMessage);
    } else if (loggingLevel == Level.DEBUG) {
        log.debug(marker, logMessage);
    } else if (loggingLevel == Level.ERROR) {
        log.error(marker, logMessage);
    } else if (loggingLevel == Level.TRACE) {
        log.trace(marker, logMessage);
    } else if (loggingLevel == Level.WARN) {
        log.warn(marker, logMessage);
    } else {
        log.info(marker, logMessage);
    }
}
 
Example 2
Source File: HyenaExceptionHandler.java    From hyena with Apache License 2.0 5 votes vote down vote up
private void logException(BaseException exp) {
    if (exp.getLogLevel() == Level.ERROR) {
        logger.error(exp.getMessage(), exp);
    } else if (exp.getLogLevel() == Level.WARN) {
        logger.warn(exp.getMessage(), exp);
    } else if (exp.getLogLevel() == Level.INFO) {
        logger.info(exp.getMessage(), exp);
    } else if (exp.getLogLevel() == Level.DEBUG) {
        logger.debug(exp.getMessage(), exp);
    } else if (exp.getLogLevel() == Level.TRACE) {
        logger.trace(exp.getMessage(), exp);
    } else {
        logger.error(exp.getMessage(), exp);
    }
}
 
Example 3
Source File: StdErrorReporter.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Level getCurrentLogLevel()
{
    Level level = null; // no logging, aka OFF
    org.slf4j.Logger crtLogger = mainLogger;
    if (crtLogger.isTraceEnabled())
    {
        level = Level.TRACE;
    }
    else
    if (crtLogger.isDebugEnabled())
    {
        level = Level.DEBUG;
    }
    else
    if (crtLogger.isInfoEnabled())
    {
        level = Level.INFO;
    }
    else
    if (crtLogger.isWarnEnabled())
    {
        level = Level.WARN;
    }
    else
    if (crtLogger.isErrorEnabled())
    {
        level = Level.ERROR;
    }
    return level;
}
 
Example 4
Source File: LinstorParsingUtils.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
public static Level asLogLevel(String logLevelRef)
{
    Level logLevel;
    if (logLevelRef == null || logLevelRef.isEmpty())
    {
        throw new ApiRcException(
            ApiCallRcImpl.simpleEntry(
                ApiConsts.FAIL_INVLD_CONF,
                "Given loglevel is null."
            )
        );
    }

    switch (logLevelRef.toUpperCase())
    {
        case "ERROR":
            logLevel = Level.ERROR;
            break;
        case "WARN":
            logLevel = Level.WARN;
            break;
        case "INFO":
            logLevel = Level.INFO;
            break;
        case "DEBUG":
            logLevel = Level.DEBUG;
            break;
        case "TRACE":
            logLevel = Level.TRACE;
            break;
        default:
            throw new ApiRcException(
                ApiCallRcImpl.simpleEntry(
                    ApiConsts.FAIL_INVLD_CONF,
                    "Given loglevel '" + logLevelRef + "' is invalid"
                )
            );
    }
    return logLevel;
}
 
Example 5
Source File: StderrErrorReporter.java    From linstor-server with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Level getCurrentLogLevel()
{
    return Level.TRACE;
}
 
Example 6
Source File: EmptyErrorReporter.java    From linstor-server with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Level getCurrentLogLevel()
{
    return Level.TRACE;
}
 
Example 7
Source File: DefaultErrorStreamErrorReporter.java    From linstor-server with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Level getCurrentLogLevel()
{
    return Level.TRACE;
}
 
Example 8
Source File: WorkerPoolTest.java    From linstor-server with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Level getCurrentLogLevel()
{
    return Level.TRACE;
}
 
Example 9
Source File: StopWatch.java    From webanno with Apache License 2.0 4 votes vote down vote up
public StopWatch(Logger aLogger, String aMessage, Object... aValues)
{
    this(aLogger, Level.TRACE, aMessage, aValues);
}