Saturday, February 04, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: UdpAppender uses UdpClient?
Prev Next
You are not authorized to post a reply.

Author Messages
Ian Dykes

10/25/2007 12:21 PM  

Hi,

We're looking to use the RemoteSyslogAppender from a bunch of Windows
services running on the same machine, sending log events to one server
listening to one port.  Looking through the source, RemoteSyslogAppender
inherits from UdpAppender, and UdpAppender uses a UdpClient object.  If
I try to start two applications on the same machine aiming to send log
event to the same remote sys log I get an error saying "only one usage
of socket address is normally permitted".

I've seen this exception before in my own work with sockets, and I got
around it by using a Socket instead of UdpClient, but I suspect you can
set the ExclusiveAddressUse property as well.  I can't see a way of
setting this property through the appender though.

Is there any way I can use multiple UdpAppenders/RemoteSyslogAppenders
sending to the same address/port on the same machine?

Thanks
Ian

Ian Dykes
Software Developer
Esendex Ltd

T: +44 (0)115 852 5762
F: +44 (0)115 852 5757
Email: ian.dykes@esendex.com
Web: www.esendex.com
Blog: http://devproj20.blogspot.com/

Esendex: Connect and Communicate

Confidentiality: This e-mail (and any associated files) is intended only for the use of log4net-user@logging.apache.org and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not log4net-user@logging.apache.org you are hereby notified that any disclosure, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and then delete it from your computer. Messages sent to and from us may be monitored. The views expressed in this message are those of the author Ian Dykes and do not necessarily represent the views of Esendex Ltd.

Security: This e-mail and any attachments are believed to be free from any virus but it is the responsibility of the recipient to ensure this is so. E-mail is not a 100% secure communications medium. We recommend you observe this when e-mailing us.

Esendex Ltd is a limited company registered in the UK, with company number 04217280 and having its registered office at 32a Stoney Street . Nottingham . NG1 1LL . United Kingdom.

[v1.1 EN]

Walden H. Leverich

10/25/2007 5:12 PM  

Are you setting the LocalPort for the RemoteSyslogAppender? You
shouldn't be. In the InitializeClientConnection of the UdpAppender you
should see:

       if (this.LocalPort == 0)
        {
            this.Client = new UdpClient();
        }
        else
        {
            this.Client = new UdpClient(this.LocalPort);
        }

If localport is 0 then the client is created w/out a port, so you should
get a random (and unused) one. If you've set the local port, then yes,
the second attempt to open will fail since you've already bound
something to that port.

-Walden

--
Walden H Leverich III
Tech Software
(516) 627-3800 x3051
WaldenL@TechSoftInc.com
http://www.TechSoftInc.com

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)

Ian Dykes

10/25/2007 5:17 PM  

Ahh, that does explain something.  I'll give it a go and see if it
works.

Thanks
Ian



Ian Dykes
Software Developer
Esendex Ltd

T: +44 (0)115 852 5762
F: +44 (0)115 852 5757
Email: ian.dykes@esendex.com
Web: www.esendex.com
Blog: http://devproj20.blogspot.com/

Esendex: Connect and Communicate

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > UdpAppender uses UdpClient?



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement