Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-120

Socket/Syslog appenders throw IOException if destination socket is not open

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta2
    • 2.0-beta4
    • Appenders
    • None
    • Java 1.6.0_24

    Description

      If Log4J2 is initialized with a configured Socket or Syslog appender, and the destination socket is not open, a IOException is thrown within TCPSocketManagerFactory on the "new Socket(data.host, data.port)" line.

      This exception results in either a NullPointerException thrown to the calling code, regardless if if suppressExceptions is true or false. No reconnect attempt is made, regardless if reconnectionDelay is set to a positive number.

      The socket can still be created by TCPSocketManagerFactory, but attempting to connect to the socket should wait until the first logging statement so that reconnection retries may be used.

      Attachments

        1. log4j2.xml
          0.4 kB
          Scott Severtson
        2. TestConnectBehavior.java
          0.7 kB
          Scott Severtson

        Activity

          People

            rgoers Ralph Goers
            ssevertson Scott Severtson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: