Class Logging
- java.lang.Object
-
- akka.event.Logging
-
public class Logging extends java.lang.Object
-
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description Logging()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static scala.collection.immutable.Seq<Logging.LogLevel>AllLogLevels()static DiagnosticLoggingAdapterapply(Actor logSource)Obtain 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 java.lang.Class<? extends Logging.LogEvent>classFor(Logging.LogLevel level)Returns the event class associated with the given LogLevelstatic Logging.LogLevelDebugLevel()static scala.collection.immutable.Map<java.lang.String,java.lang.Object>emptyMDC()LoggingAdapter extension which adds MDC support.static Logging.LogLevelErrorLevel()static DiagnosticLoggingAdaptergetLogger(Actor logSource)Obtain LoggingAdapter with MDC support for the given actor.static LoggingAdaptergetLogger(ActorSystem system, java.lang.Object logSource)Obtain LoggingAdapter for the given actor system and source object.static DiagnosticLoggingAdaptergetLogger(UntypedActor logSource)Deprecated.Use AbstractActor instead of UntypedActor.static LoggingAdaptergetLogger(LoggingBus bus, java.lang.Object logSource)Obtain LoggingAdapter for the given logging bus and source object.static Logging.LogLevelInfoLevel()static Logging.LogLevellevelFor(java.lang.Class<? extends Logging.LogEvent> eventClass)static scala.Option<Logging.LogLevel>levelFor(java.lang.String s)static Logging.LoggerInitialized$loggerInitialized()static java.lang.StringmessageClassName(java.lang.Object message)static akka.event.Logging.Error.NoCause$noCause()static Logging.LogLevelOffLevel()static java.lang.StringsimpleName(java.lang.Class<?> clazz)static java.lang.StringsimpleName(java.lang.Object obj)static java.lang.StringstackTraceFor(java.lang.Throwable e)static Logging.StandardOutLoggerStandardOutLogger()static Logging.LogLevelWarningLevel()static DiagnosticMarkerBusLoggingAdapterwithMarker(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.
-
-
-
Method Detail
-
simpleName
public static java.lang.String simpleName(java.lang.Object obj)
-
simpleName
public static java.lang.String simpleName(java.lang.Class<?> clazz)
-
messageClassName
public static java.lang.String messageClassName(java.lang.Object message)
-
ErrorLevel
public static final Logging.LogLevel ErrorLevel()
-
WarningLevel
public static final Logging.LogLevel WarningLevel()
-
InfoLevel
public static final Logging.LogLevel InfoLevel()
-
DebugLevel
public static final Logging.LogLevel DebugLevel()
-
OffLevel
public static final Logging.LogLevel OffLevel()
-
levelFor
public static scala.Option<Logging.LogLevel> levelFor(java.lang.String s)
-
levelFor
public static Logging.LogLevel levelFor(java.lang.Class<? extends Logging.LogEvent> eventClass)
-
classFor
public static java.lang.Class<? extends Logging.LogEvent> classFor(Logging.LogLevel level)
Returns the event class associated with the given LogLevel- Parameters:
level- (undocumented)- Returns:
- (undocumented)
-
AllLogLevels
public static scala.collection.immutable.Seq<Logging.LogLevel> AllLogLevels()
-
apply
public static <T> LoggingAdapter apply(ActorSystem system, T logSource, LogSource<T> evidence$3)
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
LogSourcefor details.You can add your own rules quite easily, see
LogSource.- Parameters:
system- (undocumented)logSource- (undocumented)evidence$3- (undocumented)- Returns:
- (undocumented)
-
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
LogSourcefor details.You can add your own rules quite easily, see
LogSource.- Parameters:
system- (undocumented)logSource- (undocumented)evidence$4- (undocumented)- Returns:
- (undocumented)
-
apply
public static <T> LoggingAdapter apply(LoggingBus bus, T logSource, LogSource<T> evidence$5)
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
LogSourcefor details.You can add your own rules quite easily, see
LogSource.Note that this
LoggingAdapterwill use theDefaultLoggingFilter, and not theLoggingFilterconfigured for the system (if different fromDefaultLoggingFilter).- Parameters:
bus- (undocumented)logSource- (undocumented)evidence$5- (undocumented)- Returns:
- (undocumented)
-
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
LogSourcefor details.You can add your own rules quite easily, see
LogSource.Note that this
LoggingAdapterwill use theDefaultLoggingFilter, and not theLoggingFilterconfigured for the system (if different fromDefaultLoggingFilter).- Parameters:
bus- (undocumented)logSource- (undocumented)evidence$6- (undocumented)- Returns:
- (undocumented)
-
apply
public static DiagnosticLoggingAdapter apply(Actor logSource)
Obtain LoggingAdapter with MDC support for the given actor. Don't use it outside its specific Actor as it isn't thread safe- Parameters:
logSource- (undocumented)- Returns:
- (undocumented)
-
withMarker
public static DiagnosticMarkerBusLoggingAdapter withMarker(Actor logSource)
-
getLogger
public static LoggingAdapter getLogger(ActorSystem system, java.lang.Object logSource)
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
LogSourcefor details.- Parameters:
system- (undocumented)logSource- (undocumented)- Returns:
- (undocumented)
-
getLogger
public static LoggingAdapter getLogger(LoggingBus bus, java.lang.Object logSource)
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
LogSourcefor details.Note that this
LoggingAdapterwill use theDefaultLoggingFilter, and not theLoggingFilterconfigured for the system (if different fromDefaultLoggingFilter).- Parameters:
bus- (undocumented)logSource- (undocumented)- Returns:
- (undocumented)
-
getLogger
public static DiagnosticLoggingAdapter getLogger(Actor logSource)
Obtain LoggingAdapter with MDC support for the given actor. Don't use it outside its specific Actor as it isn't thread safe- Parameters:
logSource- (undocumented)- Returns:
- (undocumented)
-
getLogger
public static DiagnosticLoggingAdapter getLogger(UntypedActor logSource)
Deprecated.Use AbstractActor instead of UntypedActor. Since 2.5.0.Obtain LoggingAdapter with MDC support for the given actor. Don't use it outside its specific Actor as it isn't thread safe- Parameters:
logSource- (undocumented)- Returns:
- (undocumented)
-
noCause
public static akka.event.Logging.Error.NoCause$ noCause()
-
loggerInitialized
public static Logging.LoggerInitialized$ loggerInitialized()
-
StandardOutLogger
public static Logging.StandardOutLogger StandardOutLogger()
-
stackTraceFor
public static java.lang.String stackTraceFor(java.lang.Throwable e)
-
emptyMDC
public static scala.collection.immutable.Map<java.lang.String,java.lang.Object> emptyMDC()
LoggingAdapter extension which adds MDC support. Only recommended to be used within Actors as it isn't thread safe.- Returns:
- (undocumented)
-
-