Question

From what I can tell, all of the existing log4net appenders are designed to push messages. I have an application with multiple services, and I want to make it easy for devs to subscribe to log messages on-demand.

There are a couple of benefits to this approach:

  • Low overhead when no one is subscribed
  • No need to open up firewall ports on the subscriber side
  • No need to turn appenders on/off at runtime

One thought I have is to use UDP to push all of the messages to a central location, and have that server set up to allow SignalR clients to subscribe.

I'm hoping there are existing solutions. This seems like a common scenario.

Was it helpful?

Solution 2

I couldn't find an existing solution, so I created my own:

log4stuff.com

OTHER TIPS

I'm not aware of any exciting solution using UDP to push the logs. However log4net appenders are really easy to write.

To comment on your benefits:

•Low overhead when no one is subscribed

This is not really true, you still have to do all appender logic in the log4net application. Your program is not aware of if someone is subscribed.

•No need to open up firewall ports on the subscriber side

Messages are leaking on your network, anyone can get them. You have to recheck all logging on security information.

•No need to turn appenders on/off at runtime

Appenders are running all the time, so they will have a performance impact on your application. Log4net is light wait, but the more you log and push even debug information, it will not improve your performance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top