Class SocketOutputTarget

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.ObjectOutputStream m_outputStream
      Output strem to write the log
      private java.net.Socket m_socket
      Socket to communicate with the server
    • Constructor Summary

      Constructors 
      Constructor Description
      SocketOutputTarget​(java.lang.String host, int port)
      Creates the output target with the end point specified by host and port
      SocketOutputTarget​(java.net.InetAddress address, int port)
      Creates output target with the end point specified by the address and port
    • Field Detail

      • m_socket

        private java.net.Socket m_socket
        Socket to communicate with the server
      • m_outputStream

        private java.io.ObjectOutputStream m_outputStream
        Output strem to write the log
    • Constructor Detail

      • SocketOutputTarget

        public SocketOutputTarget​(java.net.InetAddress address,
                                  int port)
                           throws java.io.IOException
        Creates output target with the end point specified by the address and port
        Parameters:
        address - end point address
        port - the end point port
        Throws:
        java.io.IOException - if an I/O error ocurrs when creating socket
      • SocketOutputTarget

        public SocketOutputTarget​(java.lang.String host,
                                  int port)
                           throws java.io.IOException
        Creates the output target with the end point specified by host and port
        Parameters:
        host - end point host
        port - the end point port
        Throws:
        java.io.IOException - if an I/O error ocurrs when creating socket
    • Method Detail

      • write

        protected void write​(LogEvent event)
        Writes the output as a LogEvent without formatting. Formatting ia applied on the server side where it is log.
        Parameters:
        event - the LogEvent
      • close

        public void close()
        Shutdown target. Attempting to write to target after close() will cause errors to be logged.
        Specified by:
        close in interface Closeable
        Overrides:
        close in class AbstractOutputTarget