logWithMarker
Log elements flowing through the stream as well as completion and erroring.
Signature¶
Source.logWithMarker
Flow.logWithMarker
Description¶
Log elements flowing through the stream as well as completion and erroring. By default element and completion signals are logged on debug level, and errors are logged on Error level. This can be changed by calling Attributes.logLevels(...)
on the given Flow.
See also log.
Example¶
sourceimport org.apache.pekko
import pekko.event.LogMarker
import pekko.stream.Attributes
.logWithMarker(name = "myStream", e => LogMarker(name = "myMarker", properties = Map("element" -> e)))
.addAttributes(
Attributes.logLevels(
onElement = Attributes.LogLevels.Off,
onFinish = Attributes.LogLevels.Info,
onFailure = Attributes.LogLevels.Error))
source.logWithMarker(
"myStream", (e) -> LogMarker.create("myMarker", Collections.singletonMap("element", e)))
.addAttributes(
Attributes.createLogLevels(
Attributes.logLevelOff(), // onElement
Attributes.logLevelInfo(), // onFinish
Attributes.logLevelError())) // onFailure
Reactive Streams semantics¶
emits when upstream emits
backpressures when downstream backpressures
completes when upstream completes
1.1.3