Logging - Horusiath/Akkling GitHub Wiki

Akkling supports two groups of logging functions - one that operates directly on strings and second (which may be recognized by f suffix in function names) which operates using F# string formatting features. Major difference is performance - first one is less powerful, but it's also faster than the second one.

Both groups support logging on various levels (DEBUG, INFO, WARNING and ERROR). Actor system's logging level may be managed through configuration, i.e.:

akka {
    actor {
        # collection of loggers used inside actor system, specified by fully-qualified type name
        loggers = [ "Akka.Event.DefaultLogger, Akka" ]

        # Options: OFF, ERROR, WARNING, INFO, DEBUG
        logLevel = "DEBUG"
    }
}

F# API provides following logging methods:

  • log (level : LogLevel) (mailbox : Actor<'Message>) (msg : string) : unit and logf (level : LogLevel) (mailbox : Actor<'Message>) (format:StringFormat<'T, 'Result>) : 'T - both functions takes an Akka.Event.LogLevel enum parameter to specify log level explicitly.
  • logDebug, logDebugf - message will be logged at Debug level.
  • logInfo, logInfof - message will be logged at Info level.
  • logWarning, logWarningf - message will be logged at Warning level.
  • logError, logError - message will be logged at Error level.
  • logException (mailbox: Actor<'a>) (e : exn) : unit - this function logs a message from provided System.Exception object at the Error level.
⚠️ **GitHub.com Fallback** ⚠️