Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-261

RemoteSyslogAppender doesn't work because of IPv6

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.2.10
    • None
    • Appenders
    • None
    • Windows Seven x86_64
      Visual Studio Team System unit test

    Description

      I tried to make experiments with Log4net and Syslog appender for a research open source project I'm working.
      Tried to send the log messages to a local UDP listener using RemoteSyslogAppender.

      Logging code executed but on the debug console I got an exception:

      log4net:ERROR [RemoteSyslogAppender] Unable to send logging event to remote syslog fe80::8038:6515:ad7a:bdb5%15 on port 3434.
      System.Net.Sockets.SocketException: Indirizzo utilizzato incompatibile con il protocollo richiesto [Address used is incompatible with required protocol]
      in System.Net.Sockets.Socket.SendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP)
      in System.Net.Sockets.UdpClient.Send(Byte[] dgram, Int32 bytes, IPEndPoint endPoint)
      in log4net.Appender.RemoteSyslogAppender.Append(LoggingEvent loggingEvent)
      ALL: 2010-07-06 23:24:11,364 [Agent: adapter run thread for test 'TestMethod' with id 'f3dfe8eb-635a-4683-8777-a029f3897071'] ERROR ALL [(null)] - Test error message

      RemoteSyslogAppender is trying to send the message to an IPv6 address rather than 127.0.0.1
      Precisely, if I configure <remoteAddress> as "localhost", it tries to send to ::1, if I use "127.0.0.1" it tries to send to an IPv6 link-local address (fe80:...)

      Code can be found at https://logbus-ng.svn.sourceforge.net/viewvc/logbus-ng/trunk/logbus-core/Log4test/?pathrev=106 as a Visual Studio Unit Test.
      It is revision 106 of https://logbus-ng.svn.sourceforge.net/svnroot/logbus-ng/trunk/logbus-core/Log4test/

      I tried to look at RemoteSyslogAppender implementation. I couldn't find a possible root cause because I can see you correctly initialize the UdpClient with parameterless constructor (UdpAppender::InitializeConnection()).
      The only way I could send datagrams was to use a FQDN as remoteAddress for which only A record is defined in the DNS.

      I also found that the RemoteSyslog appender doesn't respect RFC3164 by default unless you configure it with an appropriate pattern. I will open a new issue about it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              djechelon usr-local-echelon
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 3h
                  3h
                  Remaining:
                  Remaining Estimate - 3h
                  3h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified