|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectakka.event.Logging$
public class Logging$
Main entry point for Akka logging: log levels and message types (aka channels) defined for the main transport medium, the main event bus. The recommended use is to obtain an implementation of the Logging trait with suitable and efficient methods for generating log events:
val log = Logging(<bus>, <source object>)
...
log.info("hello world!")
The source object is used in two fashions: its Class[_]
will be part of
all log events produced by this logger, plus a string representation is
generated which may contain per-instance information, see apply
or create
below.
Loggers are attached to the level-specific channels Error
,
Warning
, Info
and Debug
as
appropriate for the configured (or set) log level. If you want to implement
your own, make sure to handle these four event types plus the InitializeLogger
message which is sent before actually attaching it to the logging bus.
Logging is configured by setting (some of) the following:
akka {
loggers = ["akka.slf4j.Slf4jLogger"] # for example
loglevel = "INFO" # used when normal logging ("loggers") has been started
stdout-loglevel = "WARN" # used during application start-up until normal logging is available
}
Field Summary | |
---|---|
static Logging$ |
MODULE$
Static reference to the singleton instance of this Scala object. |
Constructor Summary | |
---|---|
Logging$()
|
Method Summary | ||
---|---|---|
scala.collection.immutable.Seq<Logging.LogLevel> |
AllLogLevels()
|
|
DiagnosticLoggingAdapter |
apply(Actor logSource)
Obtain LoggingAdapter with MDC support for the given actor. |
|
|
apply(ActorSystem system,
T logSource,
LogSource<T> evidence$3)
Obtain LoggingAdapter for the given actor system and source object. |
|
|
apply(LoggingBus bus,
T logSource,
LogSource<T> evidence$4)
Obtain LoggingAdapter for the given logging bus and source object. |
|
java.lang.Class<? extends Logging.LogEvent> |
classFor(Logging.LogLevel level)
Returns the event class associated with the given LogLevel |
|
Logging.LogLevel |
DebugLevel()
|
|
scala.collection.immutable.Map<java.lang.String,java.lang.Object> |
emptyMDC()
|
|
Logging.LogLevel |
ErrorLevel()
Log level in numeric form, used when deciding whether a certain log statement should generate a log event. |
|
LoggingAdapter |
getLogger(ActorSystem system,
java.lang.Object logSource)
Obtain LoggingAdapter for the given actor system and source object. |
|
LoggingAdapter |
getLogger(LoggingBus bus,
java.lang.Object logSource)
Obtain LoggingAdapter for the given logging bus and source object. |
|
DiagnosticLoggingAdapter |
getLogger(UntypedActor logSource)
Obtain LoggingAdapter with MDC support for the given actor. |
|
Logging.LogLevel |
InfoLevel()
|
|
Logging.LogLevel |
levelFor(java.lang.Class<? extends Logging.LogEvent> eventClass)
Returns the LogLevel associated with the given event class. |
|
scala.Option<Logging.LogLevel> |
levelFor(java.lang.String s)
Returns the LogLevel associated with the given string, valid inputs are upper or lowercase (not mixed) versions of: "error", "warning", "info" and "debug" |
|
Logging.LoggerInitialized$ |
loggerInitialized()
Java API to create a LoggerInitialized message. |
|
Logging.Error.NoCause$ |
noCause()
|
|
java.lang.String |
simpleName(java.lang.Class<?> clazz)
Returns a 'safe' getSimpleName for the provided Class |
|
java.lang.String |
simpleName(java.lang.Object obj)
Returns a 'safe' getSimpleName for the provided object's Class |
|
java.lang.String |
stackTraceFor(java.lang.Throwable e)
Returns the StackTrace for the given Throwable as a String |
|
Logging.StandardOutLogger |
StandardOutLogger()
|
|
Logging.LogLevel |
WarningLevel()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Logging$ MODULE$
Constructor Detail |
---|
public Logging$()
Method Detail |
---|
public java.lang.String simpleName(java.lang.Object obj)
obj
-
public java.lang.String simpleName(java.lang.Class<?> clazz)
obj
- clazz
- (undocumented)
public final Logging.LogLevel ErrorLevel()
public final Logging.LogLevel WarningLevel()
public final Logging.LogLevel InfoLevel()
public final Logging.LogLevel DebugLevel()
public scala.Option<Logging.LogLevel> levelFor(java.lang.String s)
s
- (undocumented)
public Logging.LogLevel levelFor(java.lang.Class<? extends Logging.LogEvent> eventClass)
eventClass
- (undocumented)
public java.lang.Class<? extends Logging.LogEvent> classFor(Logging.LogLevel level)
level
- (undocumented)
public scala.collection.immutable.Seq<Logging.LogLevel> AllLogLevels()
public <T> LoggingAdapter apply(ActorSystem system, T logSource, LogSource<T> evidence$3)
Do not use this if you want to supply a log category string (like
“com.example.app.whatever”) unaltered, supply system.eventStream
in this
case or use
Logging(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 LogSource
for details.
You can add your own rules quite easily, see LogSource
.
system
- (undocumented)logSource
- (undocumented)evidence$3
- (undocumented)
public <T> LoggingAdapter apply(LoggingBus bus, T logSource, LogSource<T> evidence$4)
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 LogSource
for details.
You can add your own rules quite easily, see LogSource
.
bus
- (undocumented)logSource
- (undocumented)evidence$4
- (undocumented)
public DiagnosticLoggingAdapter apply(Actor logSource)
logSource
- (undocumented)
public LoggingAdapter getLogger(ActorSystem system, java.lang.Object logSource)
Do not use this if you want to supply a log category string (like
“com.example.app.whatever”) unaltered, supply system.eventStream
in this
case or use
Logging.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 LogSource
for details.
system
- (undocumented)logSource
- (undocumented)
public LoggingAdapter getLogger(LoggingBus bus, java.lang.Object logSource)
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 LogSource
for details.
bus
- (undocumented)logSource
- (undocumented)
public DiagnosticLoggingAdapter getLogger(UntypedActor logSource)
logSource
- (undocumented)
public Logging.Error.NoCause$ noCause()
public Logging.LoggerInitialized$ loggerInitialized()
public Logging.StandardOutLogger StandardOutLogger()
public java.lang.String stackTraceFor(java.lang.Throwable e)
e
- (undocumented)
public scala.collection.immutable.Map<java.lang.String,java.lang.Object> emptyMDC()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |