Class FileAppender

java.lang.Object
csw.logging.client.appenders.FileAppender
All Implemented Interfaces:
LogAppender

public class FileAppender extends 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

    Modifier and Type
    Method
    Description
    void
    append(play.api.libs.json.JsObject baseMsg, String category)
    Write the log message to a file.
    apply(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders)
    Constructor for a file appender.
     
    scala.concurrent.Future<scala.runtime.BoxedUnit>
    Called just before the logger shuts down.
    scala.concurrent.Future<scala.runtime.BoxedUnit>
    Closes the file appender.

    Methods inherited from class java.lang.Object

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

    • FileAppender

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

    • 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 ZonedDateTime decideTimestampForFile(ZonedDateTime logDateTime)
    • append

      public void append(play.api.libs.json.JsObject baseMsg, 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.