Package net.logstash.logback.marker
Class Markers
java.lang.Object
net.logstash.logback.marker.Markers
Convenience class for constructing various
LogstashMarker
s used to add
fields into the logstash event.
This creates a somewhat fluent interface that can be used to create markers.
For example:
import static net.logstash.logback.marker.Markers.*
logger.info(append("name1", "value1"), "log message");
logger.info(append("name1", "value1").and(append("name2", "value2")), "log message");
logger.info(appendEntries(myMap), "log message");
-
Method Summary
Modifier and TypeMethodDescriptionstatic LogstashMarker
aggregate
(Collection<? extends org.slf4j.Marker> markers) Aggregates the given markers into a single marker.static LogstashMarker
aggregate
(org.slf4j.Marker... markers) Aggregates the given markers into a single marker.static LogstashMarker
static LogstashMarker
appendArray
(String fieldName, Object... objects) static LogstashMarker
appendEntries
(Map<?, ?> map) static LogstashMarker
appendFields
(Object object) static LogstashMarker
static LogstashMarker
defer
(Supplier<? extends LogstashMarker> logstashMarkerSupplier) static LogstashMarker
empty()
-
Method Details
-
appendEntries
-
appendFields
-
append
-
appendArray
-
appendRaw
-
aggregate
Aggregates the given markers into a single marker.- Parameters:
markers
- the markers to aggregate- Returns:
- the aggregated marker.
-
aggregate
Aggregates the given markers into a single marker.- Parameters:
markers
- the markers to aggregate- Returns:
- the aggregated marker.
-
defer
-
empty
-