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

Has Log4j2 a risk of losing logs for streaming towards a remote server when it cannot re-establish a connection towards the server?

    XMLWordPrintableJSON

Details

    • Question
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.13.3
    • None
    • Appenders
    • None

    Description

      Hi,

      Currently we are trying log4j2 to stream logs towards the remote server with SocketAppender.

      I am checking the source code of TcpSocketManager and its inner class Reconnector.

      protected void TcpSocketManager:write(...)

      In the above function, once the manager cannot write to the socket, it use the reconnector to reconnect synchronizely. If it succeeds, it sends the bytes again and everything is fine.

      However, if it fails, the reconnector is going to start a seperate thread and wait for a configurable time to reconnect. But the current method throws an exception instead and the bytes/Log event is then lost due to broken connection.

      Is my understanding correct? If so, can it be improved?

      Thanks in advance. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            winniegy Yi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: