Class CustomLogWriter

  • All Implemented Interfaces:
    LogWriter

    public class CustomLogWriter
    extends Object
    implements LogWriter
    Custom implementation of LogWriter interface.
    Author:
    David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com
    • Constructor Detail

      • CustomLogWriter

        public CustomLogWriter()
    • Method Detail

      • setPrefix

        public void setPrefix​(String prefix)
        Description copied from interface: LogWriter
        prefix each statement with this value. allows connections to be correlated when logger is shared
        Specified by:
        setPrefix in interface LogWriter
      • initialMessage

        public void initialMessage​(org.slf4j.Logger log)
        Description copied from interface: LogWriter
        Writes a header message to the log.
        Specified by:
        initialMessage in interface LogWriter
        Parameters:
        log - The log to be written to.
      • logRequest

        public void logRequest​(org.slf4j.Logger log,
                               Object command)
        Description copied from interface: LogWriter
        Writes a message to a log when a request command is sent.
        Specified by:
        logRequest in interface LogWriter
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logResponse

        public void logResponse​(org.slf4j.Logger log,
                                Object response)
        Description copied from interface: LogWriter
        Writes a message to a log when a response command is received.
        Specified by:
        logResponse in interface LogWriter
        Parameters:
        log - The log to be written to.
        response - The command to be logged.
      • logAsyncRequest

        public void logAsyncRequest​(org.slf4j.Logger log,
                                    Object command)
        Description copied from interface: LogWriter
        Writes a message to a log when an asynchronous equest command is sent.
        Specified by:
        logAsyncRequest in interface LogWriter
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logOneWay

        public void logOneWay​(org.slf4j.Logger log,
                              Object command)
        Description copied from interface: LogWriter
        Writes a message to a log when message is sent.
        Specified by:
        logOneWay in interface LogWriter
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logReceivedCommand

        public void logReceivedCommand​(org.slf4j.Logger log,
                                       Object command)
        Description copied from interface: LogWriter
        Writes a message to a log when message is received.
        Specified by:
        logReceivedCommand in interface LogWriter
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logReceivedException

        public void logReceivedException​(org.slf4j.Logger log,
                                         IOException error)
        Description copied from interface: LogWriter
        Writes a message to a log when an exception is received.
        Specified by:
        logReceivedException in interface LogWriter
        Parameters:
        log - The log to be written to.
        error - The exception to be logged.