Created
December 2, 2014 16:15
-
-
Save jchapuis/739ad3f812a3d78b51f4 to your computer and use it in GitHub Desktop.
Monitoring log4net UDP appender in LinqPad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async void Main() | |
{ | |
var endPoint = new IPEndPoint(IPAddress.Loopback, 8080); | |
using (var listener = new UdpClient(endPoint)) | |
{ | |
while(true) { | |
var result = await listener.ReceiveAsync(); | |
var message = Encoding.UTF8.GetString(result.Buffer, 0, result.Buffer.Length); | |
XElement.Parse(message).Elements().ToDictionary(el=>el.Name, el=>el.Value).Dump(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment