Log4j 2
  1. Log4j 2
  2. LOG4J2-120

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta2
    • Fix Version/s: 2.0-beta4
    • Component/s: Appenders
    • Labels:
      None
    • Environment:

      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.

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

        Activity

        Scott Severtson created issue -
        Scott Severtson made changes -
        Field Original Value New Value
        Attachment log4j2.xml [ 12553679 ]
        Scott Severtson made changes -
        Attachment TestConnectBehavior.java [ 12553681 ]
        Ralph Goers made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Ralph Goers [ ralph.goers@dslextreme.com ]
        Fix Version/s 2.0-beta4 [ 12323477 ]
        Resolution Fixed [ 1 ]
        Scott Severtson made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Scott Severtson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development