Search in sources :

Example 11 with Marker

use of org.slf4j.Marker in project logging-log4j2 by apache.

the class LoggerTest method supportsCustomSLF4JMarkers.

/**
     * @see <a href="https://issues.apache.org/jira/browse/LOG4J2-793">LOG4J2-793</a>
     */
@Test
public void supportsCustomSLF4JMarkers() {
    final Marker marker = new CustomFlatMarker("TEST");
    logger.debug(marker, "Test");
    verify("List", "o.a.l.s.LoggerTest Test MDC{}" + Strings.LINE_SEPARATOR);
}
Also used : Marker(org.slf4j.Marker) Test(org.junit.Test)

Example 12 with Marker

use of org.slf4j.Marker in project logging-log4j2 by apache.

the class Log4jMarkerFactory method convertMarker.

private static org.apache.logging.log4j.Marker convertMarker(final Marker original, final Collection<Marker> visited) {
    final org.apache.logging.log4j.Marker marker = MarkerManager.getMarker(original.getName());
    if (original.hasReferences()) {
        final Iterator<Marker> it = original.iterator();
        while (it.hasNext()) {
            final Marker next = it.next();
            if (visited.contains(next)) {
                LOGGER.warn("Found a cycle in Marker [{}]. Cycle will be broken.", next.getName());
            } else {
                visited.add(next);
                marker.addParents(convertMarker(next, visited));
            }
        }
    }
    return marker;
}
Also used : Marker(org.slf4j.Marker)

Aggregations

Marker (org.slf4j.Marker)12 ByteString (com.google.protobuf.ByteString)2 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)2 Test (org.junit.Test)2 Trace (com.evolveum.midpoint.util.logging.Trace)1 CassandraFrameworkProtos (io.mesosphere.mesos.frameworks.cassandra.CassandraFrameworkProtos)1 ProtoUtils.protoToString (io.mesosphere.mesos.util.ProtoUtils.protoToString)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FilenameFilter (java.io.FilenameFilter)1 Scanner (java.util.Scanner)1 Protos (org.apache.mesos.Protos)1