Package net.logstash.logback.marker
Class Markers
java.lang.Object
net.logstash.logback.marker.Markers
Convenience class for constructing various
LogstashMarkers 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 LogstashMarkeraggregate(Collection<? extends org.slf4j.Marker> markers) Aggregates the given markers into a single marker.static LogstashMarkeraggregate(org.slf4j.Marker... markers) Aggregates the given markers into a single marker.static LogstashMarkerstatic LogstashMarkerappendArray(String fieldName, Object... objects) static LogstashMarkerappendEntries(Map<?, ?> map) static LogstashMarkerappendFields(Object object) static LogstashMarkerstatic LogstashMarkerdefer(Supplier<? extends LogstashMarker> logstashMarkerSupplier) static LogstashMarkerempty()
-
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
-