Top Description Fields Constructors Methods
reactor.core.publisher

pack-priv final Class SignalLogger<IN>

extends Object
implements SignalPeek<IN>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.SignalPeek, reactor.core.Scannable
Imports
java.time.Instant, java.util.Objects, java.util.concurrent.atomic.AtomicLong, java.util.function.Consumer, .Function, .LongConsumer, java.util.logging.Level, org.reactivestreams.Subscription, reactor.core.CorePublisher, .Fuseable, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, reactor.util.context.Context

A logging interceptor that intercepts all reactive calls and trace them. The logging level can be tuned using Level, but only FINEST, FINE, INFO, WARNING and SEVERE are taken into account.
Author
Stephane Maldini

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv final boolean
pack-priv final long
pack-priv static final AtomicLong
pack-priv final Level
pack-priv final Logger
pack-priv static final String
pack-priv static final String
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv final String
pack-priv final int
pack-priv static final int
pack-priv final CorePublisher<IN>
pack-priv static final int

Constructor Summary

AccessConstructor and Description
pack-priv
SignalLogger(CorePublisher<IN> source, String category, Level level, boolean correlateStack, SignalType... options)

pack-priv
SignalLogger(CorePublisher<IN> source, String category, Level level, boolean correlateStack, Function<String, Logger> loggerSupplier, SignalType... options)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
log(SignalType
the type of signal being logged
signalType
,
Object
the value for the signal (use empty string if not required)
signalValue
)

Structured logging with level adaptation and operator ascii graph if required.

public Runnable
public Runnable
public Runnable
public Consumer<? super Context>
onCurrentContextCall()

Overrides default reactor.core.publisher.SignalPeek.onCurrentContextCall.

A task that will run on Context read from downstream to upstream
public Consumer<? super Throwable>
public Consumer<? super IN>
public LongConsumer
public Consumer<? super Subscription>
pack-priv void
safeLog(SignalType signalType, Object signalValue)

Structured logging with level adaptation and operator ascii graph if required + protection against loggers that detect objects like Fuseable.QueueSubscription as java.util.Collection and attempt to use their iterator for logging.

public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
pack-priv static String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

AFTER_TERMINATEback to summary
pack-priv static final int AFTER_TERMINATE
ALLback to summary
pack-priv static final int ALL
CANCELback to summary
pack-priv static final int CANCEL
CONTEXT_PARENTback to summary
pack-priv static final int CONTEXT_PARENT
fuseableback to summary
pack-priv final boolean fuseable
idback to summary
pack-priv final long id
IDSback to summary
pack-priv static final AtomicLong IDS
levelback to summary
pack-priv final Level level
logback to summary
pack-priv final Logger log
LOG_TEMPLATEback to summary
pack-priv static final String LOG_TEMPLATE
LOG_TEMPLATE_FUSEABLEback to summary
pack-priv static final String LOG_TEMPLATE_FUSEABLE
ON_COMPLETEback to summary
pack-priv static final int ON_COMPLETE
ON_ERRORback to summary
pack-priv static final int ON_ERROR
ON_NEXTback to summary
pack-priv static final int ON_NEXT
ON_SUBSCRIBEback to summary
pack-priv static final int ON_SUBSCRIBE
operatorLineback to summary
pack-priv final String operatorLine
optionsback to summary
pack-priv final int options
REQUESTback to summary
pack-priv static final int REQUEST
sourceback to summary
pack-priv final CorePublisher<IN> source
SUBSCRIBEback to summary
pack-priv static final int SUBSCRIBE

Constructor Detail

SignalLoggerback to summary
pack-priv SignalLogger(CorePublisher<IN> source, String category, Level level, boolean correlateStack, SignalType... options)
SignalLoggerback to summary
pack-priv SignalLogger(CorePublisher<IN> source, String category, Level level, boolean correlateStack, Function<String, Logger> loggerSupplier, SignalType... options)

Method Detail

logback to summary
pack-priv void log(SignalType signalType, Object signalValue)

Structured logging with level adaptation and operator ascii graph if required.

Parameters
signalType:SignalType

the type of signal being logged

signalValue:Object

the value for the signal (use empty string if not required)

onAfterTerminateCallback to summary
public Runnable onAfterTerminateCall()

Implements reactor.core.publisher.SignalPeek.onAfterTerminateCall.

Doc from reactor.core.publisher.SignalPeek.onAfterTerminateCall.

A task will run after termination via Subscriber#onComplete() or Subscriber#onError(Throwable)

Returns:Runnable

A task will run after termination via Subscriber#onComplete() or Subscriber#onError(Throwable)

Annotations
@Override
@Nullable
onCancelCallback to summary
public Runnable onCancelCall()

Implements reactor.core.publisher.SignalPeek.onCancelCall.

Doc from reactor.core.publisher.SignalPeek.onCancelCall.

A task that will run on Subscription#cancel()

Returns:Runnable

A task that will run on Subscription#cancel()

Annotations
@Override
@Nullable
onCompleteCallback to summary
public Runnable onCompleteCall()

Implements reactor.core.publisher.SignalPeek.onCompleteCall.

Doc from reactor.core.publisher.SignalPeek.onCompleteCall.

A task that will run on Subscriber#onComplete()

Returns:Runnable

A task that will run on Subscriber#onComplete()

Annotations
@Override
@Nullable
onCurrentContextCallback to summary
public Consumer<? super Context> onCurrentContextCall()

Overrides default reactor.core.publisher.SignalPeek.onCurrentContextCall.

Doc from reactor.core.publisher.SignalPeek.onCurrentContextCall.

A task that will run on Context read from downstream to upstream

Returns:Consumer<? super Context>

A task that will run on Context propagation from upstream to downstream

Annotations
@Nullable
@Override
onErrorCallback to summary
public Consumer<? super Throwable> onErrorCall()

Implements reactor.core.publisher.SignalPeek.onErrorCall.

Doc from reactor.core.publisher.SignalPeek.onErrorCall.

A consumer that will observe Subscriber#onError(Throwable)}

Returns:Consumer<? super Throwable>

A consumer that will observe Subscriber#onError(Throwable)

Annotations
@Override
@Nullable
onNextCallback to summary
public Consumer<? super IN> onNextCall()

Implements reactor.core.publisher.SignalPeek.onNextCall.

Doc from reactor.core.publisher.SignalPeek.onNextCall.

A consumer that will observe Subscriber#onNext(Object)

Returns:Consumer<? super IN>

A consumer that will observe Subscriber#onNext(Object)

Annotations
@Override
@Nullable
onRequestCallback to summary
public LongConsumer onRequestCall()

Implements reactor.core.publisher.SignalPeek.onRequestCall.

Doc from reactor.core.publisher.SignalPeek.onRequestCall.

A consumer of long that will observe Subscription#request(long)}

Returns:LongConsumer

A consumer of long that will observe Subscription#request(long)}

Annotations
@Override
@Nullable
onSubscribeCallback to summary
public Consumer<? super Subscription> onSubscribeCall()

Implements reactor.core.publisher.SignalPeek.onSubscribeCall.

Doc from reactor.core.publisher.SignalPeek.onSubscribeCall.

A consumer that will observe Subscriber#onSubscribe(Subscription)

Returns:Consumer<? super Subscription>

A consumer that will observe Subscriber#onSubscribe(Subscription)

Annotations
@Override
@Nullable
safeLogback to summary
pack-priv void safeLog(SignalType signalType, Object signalValue)

Structured logging with level adaptation and operator ascii graph if required + protection against loggers that detect objects like Fuseable.QueueSubscription as java.util.Collection and attempt to use their iterator for logging.

See Also
log
scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Implements reactor.core.Scannable.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

For public consumption of attributes, prefer using scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
@Nullable
subscriptionAsStringback to summary
pack-priv static String subscriptionAsString(Subscription s)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override