Class ReplicationLogger

java.lang.Object
org.apache.derby.impl.store.replication.ReplicationLogger

public class ReplicationLogger extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    The name of the replicated database
    private final boolean
    Whether or not to print log messages to derby.log.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Print error message and the stack trace of the throwable to the log (usually derby.log) provided that verbose is true.
    void
    logText(String text, boolean writeHeader)
    Print a text to the log (usually derby.log), provided that verbose is true.

    Methods inherited from class java.lang.Object

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

    • verbose

      private final boolean verbose
      Whether or not to print log messages to derby.log. Defaults to true, but can be set to false with derby property "derby.replication.verbose=false".
    • dbname

      private final String dbname
      The name of the replicated database
  • Constructor Details

    • ReplicationLogger

      public ReplicationLogger(String dbname)
  • Method Details

    • logError

      public void logError(String msgId, Throwable t)
      Print error message and the stack trace of the throwable to the log (usually derby.log) provided that verbose is true. If verbose is false, nothing is logged.
      Parameters:
      msgId - The error message id
      t - Error trace starts from this error
    • logText

      public void logText(String text, boolean writeHeader)
      Print a text to the log (usually derby.log), provided that verbose is true.
      Parameters:
      text - The text that will be logged
      writeHeader - if true, encapsulates message in "begin error message" and "end error message" lines. If false, timestamps the text and writes it to the log without the header and footer.