Log4cxx
  1. Log4cxx
  2. LOGCXX-80

Migrated network appenders to APR network IO

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: Appender
    • Labels:
      None
    • Environment:
      Debian GNU/Linux 3.1

      Description

      This patch fixes the following issues:

      • Fix for bug LOGCXX-64: Network related appenders should be migrated to Apache Portable Runtime network io methods.
        Exception handling was improved to allow better output of error text.
      • Fixed TelnetAppender. Main loop now works again. Fixed garbage collection for closed client connections.
        Appender uses new SocketOutputStream::writeRaw() to suppress writing the length of the string before the string itself is written.
      • Minor bugfix in loglog.cpp: Output of internal logging should be prefixed with "log4cxx:" (according to the documentation)
      • The second patch fixes the syslogwriter and migrates the datagramsocket to APR.
      1. syslog-datagram.diff
        10 kB
        Andreas Fester
      2. apr1.patch
        27 kB
        Andreas Fester

        Activity

        Hide
        Curt Arnold added a comment -

        I've committed the patch and took an iteration on Windows. There were a couple of issues:

        apr_signal is not supported on Windows which was used in socketimpl.cpp. I conditionalized the code in socketimpl.cpp with #if APR_HAVE_SIGACTION so it compiles, but it may break or otherwise adversely affect the behavior.

        I've been avoiding any use of APR headers or types within the log4cxx headers which allows log4cxx applications to not be required to have APR on the include path and otherwise hides that APR is in use. I removed the apr_network_io.h and apr_lib.h includes from socketimpl.h, replaced apr_status_t with log4cxx_status_t and replaced apr_socket_t* with void*.

        Show
        Curt Arnold added a comment - I've committed the patch and took an iteration on Windows. There were a couple of issues: apr_signal is not supported on Windows which was used in socketimpl.cpp. I conditionalized the code in socketimpl.cpp with #if APR_HAVE_SIGACTION so it compiles, but it may break or otherwise adversely affect the behavior. I've been avoiding any use of APR headers or types within the log4cxx headers which allows log4cxx applications to not be required to have APR on the include path and otherwise hides that APR is in use. I removed the apr_network_io.h and apr_lib.h includes from socketimpl.h, replaced apr_status_t with log4cxx_status_t and replaced apr_socket_t* with void*.
        Hide
        Andreas Fester added a comment -

        Additional patch which migrates the datagramsocket to APR. Also makes the syslogwriter working again.

        Show
        Andreas Fester added a comment - Additional patch which migrates the datagramsocket to APR. Also makes the syslogwriter working again.
        Hide
        Andreas Fester added a comment -

        I am resolving this issue because the attached patches have already been committed. Also, there is still http://issues.apache.org/jira/browse/LOGCXX-64 which is the original issue for this one. Additional patches for APR network IO migration can be committed to that issue.

        Show
        Andreas Fester added a comment - I am resolving this issue because the attached patches have already been committed. Also, there is still http://issues.apache.org/jira/browse/LOGCXX-64 which is the original issue for this one. Additional patches for APR network IO migration can be committed to that issue.

          People

          • Assignee:
            Andreas Fester
            Reporter:
            Andreas Fester
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development