Packages

  • package root
    Definition Classes
    root
  • package csw
    Definition Classes
    root
  • package logging

    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.appenders.LogAppender:

    • csw.logging.appenders.FileAppender: Common log messages are written in Pretty Json form. This appender is useful during development. It is recommended to disable it in production.
    • csw.logging.appenders.StdOutAppender: Log messages are written as Json, one per line. Ordinary log messages are written to the common log files. Each log file includes a day as part of its name. Each day a new file is created.

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

    csw-logging {
       appenders = ["csw.logging.appenders.StdOutAppender$", "csw.logging.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
    csw
  • package appenders
    Definition Classes
    logging
  • FileAppender
  • LogAppender
  • LogAppenderBuilder
  • StdOutAppender

class StdOutAppender extends LogAppender

A log appender that writes common log messages to stdout. Stdout output can be printed as oneLine or pretty. oneLine will print only the message of the log statement in single line and pretty will print all the information of log statement.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StdOutAppender
  2. LogAppender
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StdOutAppender(factory: ActorRefFactory, stdHeaders: Map[String, RichMsg], logPrinter: (Any) ⇒ Unit)

    factory

    an Akka factory

    stdHeaders

    the headers that are fixes for this service

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def append(baseMsg: Map[String, RichMsg], category: String): Unit

    Writes a log message to stdout

    Writes a log message to stdout

    baseMsg

    the message to be logged

    category

    the kinds of log (for example, "common")

    Definition Classes
    StdOutAppenderLogAppender
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def finish(): Future[Unit]

    Called just before the logger shuts down

    Called just before the logger shuts down

    returns

    a future that is completed when finished

    Definition Classes
    StdOutAppenderLogAppender
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def stop(): Future[Unit]

    Closes the stdout appender

    Closes the stdout appender

    returns

    a future that is completed when the close is complete

    Definition Classes
    StdOutAppenderLogAppender
  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from LogAppender

Inherited from AnyRef

Inherited from Any

Ungrouped