Class FileAppender

  • All Implemented Interfaces:
    LogAppender

    public class FileAppender
    extends java.lang.Object
    implements LogAppender
    An appender that writes log messages to files.

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

    • Constructor Summary

      Constructors 
      Constructor Description
      FileAppender​(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders)  
    • 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)
      Write the log message to a file.
      static FileAppender apply​(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders)
      Constructor for a file appender.
      static java.time.ZonedDateTime decideTimestampForFile​(java.time.ZonedDateTime logDateTime)  
      scala.concurrent.Future<scala.runtime.BoxedUnit> finish()
      Called just before the logger shuts down.
      scala.concurrent.Future<scala.runtime.BoxedUnit> stop()
      Closes the file appender.
      • Methods inherited from class java.lang.Object

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

      • FileAppender

        public FileAppender​(akka.actor.typed.ActorSystem<?> system,
                            play.api.libs.json.JsObject stdHeaders)
    • Method Detail

      • apply

        public static FileAppender apply​(akka.actor.typed.ActorSystem<?> system,
                                         play.api.libs.json.JsObject stdHeaders)
        Constructor for a file appender.

        Parameters:
        system - typed Actor System.
        stdHeaders - the headers that are fixes for this service.
        Returns:
        (undocumented)
      • decideTimestampForFile

        public static java.time.ZonedDateTime decideTimestampForFile​(java.time.ZonedDateTime logDateTime)
      • append

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

        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 file appender.

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