Class StdOutAppender

  • All Implemented Interfaces:
    LogAppender

    public class StdOutAppender
    extends java.lang.Object
    implements 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.

    param: system typed Actor System param: stdHeaders the headers that are fixes for this service

    • Constructor Summary

      Constructors 
      Constructor Description
      StdOutAppender​(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders, scala.Function1<java.lang.Object,​scala.runtime.BoxedUnit> logPrinter)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(play.api.libs.json.JsObject baseMsg, java.lang.String category)
      Writes a log message to stdout
      static StdOutAppender apply​(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders)
      A constructor for the StdOutAppender class
      scala.concurrent.Future<scala.runtime.BoxedUnit> finish()
      Called just before the logger shuts down
      scala.concurrent.Future<scala.runtime.BoxedUnit> stop()
      Closes the stdout appender
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StdOutAppender

        public StdOutAppender​(akka.actor.typed.ActorSystem<?> system,
                              play.api.libs.json.JsObject stdHeaders,
                              scala.Function1<java.lang.Object,​scala.runtime.BoxedUnit> logPrinter)
    • Method Detail

      • apply

        public static StdOutAppender apply​(akka.actor.typed.ActorSystem<?> system,
                                           play.api.libs.json.JsObject stdHeaders)
        A constructor for the StdOutAppender class

        Parameters:
        system - typed Actor System
        stdHeaders - the headers that are fixes for this service
        Returns:
        the stdout appender
      • append

        public void append​(play.api.libs.json.JsObject baseMsg,
                           java.lang.String category)
        Writes a log message to stdout

        Specified by:
        append in interface LogAppender
        Parameters:
        baseMsg - the message to be logged
        category - the kinds of log (for example, "common")
      • finish

        public scala.concurrent.Future<scala.runtime.BoxedUnit> finish()
        Called just before the logger shuts down

        Specified by:
        finish in interface LogAppender
        Returns:
        a future that is completed when finished
      • stop

        public scala.concurrent.Future<scala.runtime.BoxedUnit> stop()
        Closes the stdout appender

        Specified by:
        stop in interface LogAppender
        Returns:
        a future that is completed when the close is complete