Class Logging
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic final classstatic classstatic interfacestatic classstatic classstatic interfacestatic interfacestatic classstatic classArtificial exception injected into Error events if no Throwable is supplied; used for getting a stack dump of error locations.static classstatic classstatic classstatic final classstatic classstatic classstatic interfacestatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic scala.collection.immutable.Seq<Logging.LogLevel>static DiagnosticLoggingAdapterObtain LoggingAdapter with MDC support for the given actor.static <T> LoggingAdapterapply(ActorSystem system, T logSource, LogSource<T> evidence$3) Obtain LoggingAdapter for the given actor system and source object.static <T> LoggingAdapterapply(LoggingBus bus, T logSource, LogSource<T> evidence$5) Obtain LoggingAdapter for the given logging bus and source object.static Class<? extends Logging.LogEvent>classFor(Logging.LogLevel level) Returns the event class associated with the given LogLevelstatic final Logging.LogLevelemptyMDC()LoggingAdapter extension which adds MDC support.static final Logging.LogLevelstatic DiagnosticLoggingAdapterObtain LoggingAdapter with MDC support for the given actor.static LoggingAdaptergetLogger(ActorSystem system, Object logSource) Obtain LoggingAdapter for the given actor system and source object.static LoggingAdaptergetLogger(LoggingBus bus, Object logSource) Obtain LoggingAdapter for the given logging bus and source object.static final Logging.LogLevelstatic Logging.LogLevellevelFor(Class<? extends Logging.LogEvent> eventClass) Returns the LogLevel associated with the given event class.static scala.Option<Logging.LogLevel>Returns the LogLevel associated with the given string, valid inputs are upper or lowercase (not mixed) versions of: "error", "warning", "info" and "debug"static Logging.LoggerInitialized$static StringmessageClassName(Object message) static org.apache.pekko.event.Logging.Error.NoCause$noCause()static StringsimpleName(Class<?> clazz) static StringsimpleName(Object obj) static Stringstatic Logging.StandardOutLoggerstatic final Logging.LogLevelwithMarker(Actor logSource) static <T> MarkerLoggingAdapterwithMarker(ActorSystem system, T logSource, LogSource<T> evidence$4) Obtain LoggingAdapter with additional "marker" support (which some logging frameworks are able to utilise) for the given actor system and source object.static <T> MarkerLoggingAdapterwithMarker(LoggingBus bus, T logSource, LogSource<T> evidence$6) Obtain LoggingAdapter for the given logging bus and source object.
-
Constructor Details
-
Logging
public Logging()
-
-
Method Details
-
simpleName
-
simpleName
-
messageClassName
-
ErrorLevel
-
WarningLevel
-
InfoLevel
-
DebugLevel
-
levelFor
Returns the LogLevel associated with the given string, valid inputs are upper or lowercase (not mixed) versions of: "error", "warning", "info" and "debug" -
levelFor
Returns the LogLevel associated with the given event class. Defaults to DebugLevel. -
classFor
Returns the event class associated with the given LogLevel -
AllLogLevels
-
apply
Obtain LoggingAdapter for the given actor system and source object. This will use the system’s event stream and include the system’s address in the log source string.Do not use this if you want to supply a log category string (like “com.example.app.whatever”) unaltered, supply
system.eventStreamin this case or useLogging(system, this.getClass)The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of
pekko.event.LogSourcefor details.You can add your own rules quite easily, see
pekko.event.LogSource. -
withMarker
public static <T> MarkerLoggingAdapter withMarker(ActorSystem system, T logSource, LogSource<T> evidence$4) Obtain LoggingAdapter with additional "marker" support (which some logging frameworks are able to utilise) for the given actor system and source object. This will use the system’s event stream and include the system’s address in the log source string.Do not use this if you want to supply a log category string (like “com.example.app.whatever”) unaltered, supply
system.eventStreamin this case or useLogging(system, this.getClass)The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of
pekko.event.LogSourcefor details.You can add your own rules quite easily, see
pekko.event.LogSource. -
apply
Obtain LoggingAdapter for the given logging bus and source object.The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of
pekko.event.LogSourcefor details.You can add your own rules quite easily, see
pekko.event.LogSource.Note that this
LoggingAdapterwill use thepekko.event.DefaultLoggingFilter, and not thepekko.event.LoggingFilterconfigured for the system (if different fromDefaultLoggingFilter). -
withMarker
public static <T> MarkerLoggingAdapter withMarker(LoggingBus bus, T logSource, LogSource<T> evidence$6) Obtain LoggingAdapter for the given logging bus and source object.The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of
pekko.event.LogSourcefor details.You can add your own rules quite easily, see
pekko.event.LogSource.Note that this
LoggingAdapterwill use thepekko.event.DefaultLoggingFilter, and not thepekko.event.LoggingFilterconfigured for the system (if different fromDefaultLoggingFilter). -
apply
Obtain LoggingAdapter with MDC support for the given actor. Don't use it outside its specific Actor as it isn't thread safe -
withMarker
-
getLogger
Obtain LoggingAdapter for the given actor system and source object. This will use the system’s event stream and include the system’s address in the log source string.Do not use this if you want to supply a log category string (like “com.example.app.whatever”) unaltered, supply
system.eventStreamin this case or useLogging.getLogger(system, this.getClass());The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of
pekko.event.LogSourcefor details. -
getLogger
Obtain LoggingAdapter for the given logging bus and source object.The source is used to identify the source of this logging channel and must have a corresponding implicit LogSource[T] instance in scope; by default these are provided for Class[_], Actor, ActorRef and String types. See the companion object of
pekko.event.LogSourcefor details.Note that this
LoggingAdapterwill use thepekko.event.DefaultLoggingFilter, and not thepekko.event.LoggingFilterconfigured for the system (if different fromDefaultLoggingFilter). -
getLogger
Obtain LoggingAdapter with MDC support for the given actor. Don't use it outside its specific Actor as it isn't thread safe -
noCause
public static org.apache.pekko.event.Logging.Error.NoCause$ noCause() -
loggerInitialized
-
StandardOutLogger
-
stackTraceFor
-
emptyMDC
LoggingAdapter extension which adds MDC support. Only recommended to be used within Actors as it isn't thread safe.
-