Packages

  • package root
    Definition Classes
    root
  • package csw
    Definition Classes
    root
  • package logging
    Definition Classes
    csw
  • package api
    Definition Classes
    logging
  • package client

    This is a Actor based logging library which supports writing logs to File and StdOut Console.

    Logging Service

    This is a Actor based logging library which supports writing logs to File and StdOut Console.

    Features
    • Supports component specific log levels, ex. HCD1 can choose to log at info level and HCD2 can choose to log at debug level
    • Supports dynamically changing component log levels
    • Asynchronous thread safe logging
    • Structured logging
    • Supports overriding default logging properties per component viz
    • Intercepting logs from akka/slf4j
    • Supports JSON logging
    LogActor

    LogActor is the heart of logging library. It receives messages from following classes:

    • Slf4jAppender: Intercepts Slf4j logs and forwards it to LogActor via MessageHandler
    • AkkaLogger: Intercepts Akka logs and forwards it to LogActor via MessageHandler.
    • LoggerImpl: Provides csw logging API for component writer to log messages which gets forwarded to LogActor via MessageHandler
    Logging Appenders

    This library supports two types of csw.logging.client.appenders.LogAppender:

    You can specify the appender in application.conf file as shown below:

    csw-logging {
       appenders = ["csw.logging.client.appenders.StdOutAppender$", "csw.logging.client.appenders.FileAppender$"]
     }
    Component Specific Log Levels

    For each component, ComponentLoggingState instance gets created which maintains log levels which are enabled and disabled for this particular component. Every time message gets logged by component, LoggerImpl checks in corresponding componentLoggingState whether current log level enabled or not. If enabled, then only log message gets forwarded to LogActor via MessageHandler.

    You can specify the component specific log levels in application.conf file as shown below:

    component-log-levels {
       tromboneHcd = debug
       tromboneAssembly = error
    }

    ̄ Detailed documentation of Logging Service is available at: https://tmtsoftware.github.io/csw/services/logging.html

    Definition Classes
    logging
  • package models
    Definition Classes
    logging
  • package codecs
  • AnyId
  • Level
  • Levels
  • LogMetadata
  • RequestId
  • noId

package models

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package codecs

Type Members

  1. sealed trait AnyId extends AnyRef

    The trait for logging ids.

    The trait for logging ids. It can be either a RequestId to a specific request or NoId when there is no associated request.

  2. sealed abstract class Level extends EnumEntry with LoggingSerializable with Ordered[Level]

    A logging level.

  3. case class Levels(current: Level, default: Level) extends Product with Serializable

    Current and default logging levels.

    Current and default logging levels.

    current

    the current logging level.

    default

    the default logging level.

  4. case class LogMetadata(defaultLevel: Level, akkaLevel: Level, slf4jLevel: Level, componentLevel: Level) extends LoggingSerializable with Product with Serializable

    Holds metadata information about logging configuration

  5. case class RequestId(trackingId: String = UUID.randomUUID().toString, spanId: String = "", level: Option[Level] = None) extends AnyId with Product with Serializable

    The logging id of a specific request

    The logging id of a specific request

    trackingId

    the global unique id of the request optional: A new unique id will be created if this is not specified

    spanId

    a sub-id used when a a service is called multiple times for the same global request optional: defaults to 0

    level

    a field for controlling per request log levels optional: defaults to no per request control

Value Members

  1. object Level extends Enum[Level]

    Companion object for the level trait.

  2. case object noId extends AnyId with Product with Serializable

    The id value used in logging calls when there is no associated request

Ungrouped