Search in sources :

Example 1 with Trace

use of com.evolveum.midpoint.util.logging.Trace in project midpoint by Evolveum.

the class Slf4jConnectorLogger method log.

@Override
public void log(Class<?> clazz, String method, Level level, String message, Throwable ex) {
    Trace LOGGER = TraceManager.getTrace(clazz);
    //Mark all messages from ICF as ICF
    Marker m = MarkerFactory.getMarker("ICF");
    // ERROR -> error
    if (Level.OK.equals(level)) {
        if (null == ex) {
            LOGGER.trace(m, "method: {} msg:{}", method, message);
        } else {
            LOGGER.trace(m, "method: {} msg:{}", new Object[] { method, message }, ex);
        }
    } else if (Level.INFO.equals(level)) {
        if (null == ex) {
            LOGGER.debug(m, "method: {} msg:{}", method, message);
        } else {
            LOGGER.debug(m, "method: {} msg:{}", new Object[] { method, message }, ex);
        }
    } else if (Level.WARN.equals(level)) {
        if (null == ex) {
            LOGGER.warn(m, "method: {} msg:{}", method, message);
        } else {
            LOGGER.warn(m, "method: {} msg:{}", new Object[] { method, message }, ex);
        }
    } else if (Level.ERROR.equals(level)) {
        if (null == ex) {
            LOGGER.error(m, "method: {} msg:{}", method, message);
        } else {
            LOGGER.error(m, "method: {} msg:{}", new Object[] { method, message }, ex);
        }
    }
}
Also used : Trace(com.evolveum.midpoint.util.logging.Trace) Marker(org.slf4j.Marker)

Aggregations

Trace (com.evolveum.midpoint.util.logging.Trace)1 Marker (org.slf4j.Marker)1