You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Christopher Taylor <cs...@java-internals.com> on 2001/08/28 05:04:44 UTC

Made some additions to your UDP appender

Kevin,

I'm testing the code right now, but I made a couple of small additions to
your UDP code:

- Check if the InetAddress is a MulticastAddress.  If so, create a
MulticastSocket instead and join
the group
- During cleanup, try and cast the DatagramSocket to a MulticastSocket.  If
it works, leave the group.
- added an optional MulticastInterface configuration option in case there
are multiple interface cards in the computer

Source code is attached.

-Chris

----- Original Message -----
From: "Kevin Brown" <kb...@versatilesolutions.com>
To: "LOG4J Developers Mailing List" <lo...@jakarta.apache.org>
Sent: Tuesday, August 28, 2001 2:36 AM
Subject: RE: New appender


> I needed a different kind of appender for my log4j implementation so I
> wrote one.  This UDP appender is very similar to the SocketAppender except
> it uses
> UDP.  What this allows me to do is monitor the logs on the local network
by
> simply listening to the appropriate port.  This is very handy for
> monitoring type of applications where every packet is not necessarily
> essential.
>
> Source is attached and also available at:
> http://www.versatilesolutions.com/java/UDPAppender.java
>
> Kevin Brown
> kbrown@versatilesolutions.com
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org

Re: Made some additions to your UDP appender

Posted by Christopher Taylor <cs...@java-internals.com>.
No problem... it really wasn't much extra code.

Hopefully someone will add it to the source tree.

-Chris
----- Original Message -----
From: "Kevin Brown" <kb...@versatilesolutions.com>
To: "LOG4J Developers Mailing List" <lo...@jakarta.apache.org>
Sent: Tuesday, August 28, 2001 8:42 PM
Subject: RE: Made some additions to your UDP appender


> Good idea.  I hadn't spent a lot of time with this but I knew if I wanted
to
> get outside the local network I would need to use the multicast socket.
>
> Thanks.
>
> Kevin Brown
> CTT, MCT, MCSE+Internet, MCSD, MCDBA
> VersatileSolutions
> p: 502-551-8423
> kbrown@versatilesolutions.com <ma...@versatilesolutions.com>
>
>
> -----Original Message-----
> From: Christopher Taylor [mailto:cstaylor@java-internals.com]
> Sent: Monday, August 27, 2001 11:05 PM
> To: kbrown@versatilesolutions.com
> Cc: LOG4J Developers Mailing List
> Subject: Made some additions to your UDP appender
>
>
> Kevin,
>
> I'm testing the code right now, but I made a couple of small additions to
> your UDP code:
>
> - Check if the InetAddress is a MulticastAddress.  If so, create a
> MulticastSocket instead and join
> the group
> - During cleanup, try and cast the DatagramSocket to a MulticastSocket.
If
> it works, leave the group.
> - added an optional MulticastInterface configuration option in case there
> are multiple interface cards in the computer
>
> Source code is attached.
>
> -Chris
>
> ----- Original Message -----
> From: "Kevin Brown" <kb...@versatilesolutions.com>
> To: "LOG4J Developers Mailing List" <lo...@jakarta.apache.org>
> Sent: Tuesday, August 28, 2001 2:36 AM
> Subject: RE: New appender
>
>
> > I needed a different kind of appender for my log4j implementation so I
> > wrote one.  This UDP appender is very similar to the SocketAppender
except
> > it uses
> > UDP.  What this allows me to do is monitor the logs on the local network
> by
> > simply listening to the appropriate port.  This is very handy for
> > monitoring type of applications where every packet is not necessarily
> > essential.
> >
> > Source is attached and also available at:
> > http://www.versatilesolutions.com/java/UDPAppender.java
> >
> > Kevin Brown
> > kbrown@versatilesolutions.com
> >
>
>
> --------------------------------------------------------------------------
--
> ----
>
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


RE: Made some additions to your UDP appender

Posted by Kevin Brown <kb...@versatilesolutions.com>.
Good idea.  I hadn't spent a lot of time with this but I knew if I wanted to
get outside the local network I would need to use the multicast socket.

Thanks.

Kevin Brown
CTT, MCT, MCSE+Internet, MCSD, MCDBA
VersatileSolutions
p: 502-551-8423
kbrown@versatilesolutions.com <ma...@versatilesolutions.com>


-----Original Message-----
From: Christopher Taylor [mailto:cstaylor@java-internals.com]
Sent: Monday, August 27, 2001 11:05 PM
To: kbrown@versatilesolutions.com
Cc: LOG4J Developers Mailing List
Subject: Made some additions to your UDP appender


Kevin,

I'm testing the code right now, but I made a couple of small additions to
your UDP code:

- Check if the InetAddress is a MulticastAddress.  If so, create a
MulticastSocket instead and join
the group
- During cleanup, try and cast the DatagramSocket to a MulticastSocket.  If
it works, leave the group.
- added an optional MulticastInterface configuration option in case there
are multiple interface cards in the computer

Source code is attached.

-Chris

----- Original Message -----
From: "Kevin Brown" <kb...@versatilesolutions.com>
To: "LOG4J Developers Mailing List" <lo...@jakarta.apache.org>
Sent: Tuesday, August 28, 2001 2:36 AM
Subject: RE: New appender


> I needed a different kind of appender for my log4j implementation so I
> wrote one.  This UDP appender is very similar to the SocketAppender except
> it uses
> UDP.  What this allows me to do is monitor the logs on the local network
by
> simply listening to the appropriate port.  This is very handy for
> monitoring type of applications where every packet is not necessarily
> essential.
>
> Source is attached and also available at:
> http://www.versatilesolutions.com/java/UDPAppender.java
>
> Kevin Brown
> kbrown@versatilesolutions.com
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org