Interface LogWriter

  • All Known Implementing Classes:
    CustomLogWriter, DefaultLogWriter

    public interface LogWriter
    Interface for classes that will be called by the TransportLogger class to actually write to a log file. Every class that implements this interface has do be declared in the resources/META-INF/services/org/apache/activemq/transport/logwriters directory, by creating a file with the name of the writer (for example "default") and including the line class=org.apache.activemq.transport.logwriters.(Name of the LogWriter class)
    Author:
    David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void initialMessage​(org.slf4j.Logger log)
      Writes a header message to the log.
      void logAsyncRequest​(org.slf4j.Logger log, Object command)
      Writes a message to a log when an asynchronous equest command is sent.
      void logOneWay​(org.slf4j.Logger log, Object command)
      Writes a message to a log when message is sent.
      void logReceivedCommand​(org.slf4j.Logger log, Object command)
      Writes a message to a log when message is received.
      void logReceivedException​(org.slf4j.Logger log, IOException error)
      Writes a message to a log when an exception is received.
      void logRequest​(org.slf4j.Logger log, Object command)
      Writes a message to a log when a request command is sent.
      void logResponse​(org.slf4j.Logger log, Object command)
      Writes a message to a log when a response command is received.
      void setPrefix​(String prefix)
      prefix each statement with this value.
    • Method Detail

      • setPrefix

        void setPrefix​(String prefix)
        prefix each statement with this value. allows connections to be correlated when logger is shared
        Parameters:
        prefix -
      • initialMessage

        void initialMessage​(org.slf4j.Logger log)
        Writes a header message to the log.
        Parameters:
        log - The log to be written to.
      • logRequest

        void logRequest​(org.slf4j.Logger log,
                        Object command)
        Writes a message to a log when a request command is sent.
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logResponse

        void logResponse​(org.slf4j.Logger log,
                         Object command)
        Writes a message to a log when a response command is received.
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logAsyncRequest

        void logAsyncRequest​(org.slf4j.Logger log,
                             Object command)
        Writes a message to a log when an asynchronous equest command is sent.
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logOneWay

        void logOneWay​(org.slf4j.Logger log,
                       Object command)
        Writes a message to a log when message is sent.
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logReceivedCommand

        void logReceivedCommand​(org.slf4j.Logger log,
                                Object command)
        Writes a message to a log when message is received.
        Parameters:
        log - The log to be written to.
        command - The command to be logged.
      • logReceivedException

        void logReceivedException​(org.slf4j.Logger log,
                                  IOException error)
        Writes a message to a log when an exception is received.
        Parameters:
        log - The log to be written to.
        error - The exception to be logged.