log
Log elements flowing through the stream as well as completion and erroring.
Signature
Source.log
Source.log
Flow.log
Flow.log
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(...)
Attributes.createLogLevels(...)
on the given Flow.
See also logWithMarker.
Example
- Scala
-
source
import org.apache.pekko.stream.Attributes .log(name = "myStream") .addAttributes( Attributes.logLevels( onElement = Attributes.LogLevels.Off, onFinish = Attributes.LogLevels.Info, onFailure = Attributes.LogLevels.Error))
- Java
-
source
import org.apache.pekko.event.LogMarker; import org.apache.pekko.stream.Attributes; .log("myStream") .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.2+24-bcd44ee3*