datalust/seq-client-log4net

Buffer/retry/timeout support?

taylus opened this issue · 2 comments

Hi,

Great project! I am excited and impressed by how easy it is to set up Seq and get a log4net application logging to it. I am looking into Seq for use at my organization and was wondering if the log4net SeqAppender can/will/(should?) support any kind of event buffering/resending as described here:

https://docs.getseq.net/v4/discuss/588b5c8870e57b2f0031b689

I see a timeout property in SeqAppender.cs but I'm not sure if it's being used or if that even helps here. When I stop my local Seq service and take a peek at traffic using Fiddler it doesn't seem to be waiting as long as I've configured the timeout. But that might be because getting something like an HTTP 502 response back is different than getting no response.

I understand not wanting to slow down apps by synchronously trying and retrying to log (particularly at low buffer sizes). I also understand that log4net isn't the best choice for logging to Seq. We're using it in some existing apps, but changing logging frameworks or forwarding logs isn't off the table.

If this something you'd be receptive to a pull request?

Thank you!

Hi @taylus - thanks for getting in touch!

Have you tried setting a bufferSize greater than 1 for the Seq appender? https://github.com/datalust/seq-client/blob/master/example/SeqLog4NetExample/App.config#L16

I'm currently anticipating our next seq-client work to be on the new Seq NLog target, since they've (like Serilog) added support for structured logging. Time for log4net is a little slim, due mostly to it being stagnant itself - if you have the option to migrate forwards to NLog or Serilog I'd recommend it, considering the effort involved in migrating is probably similar or less than the effort to add features to the log4net integration.

If you decide not to move frameworks, though, then help adding features here would be appreciated. We'd definitely be supportive of improving batching etc. if you are able to submit PRs. Let me know which direction you decide to take :-)

All the best,
Nick

Closing as this ticket's a little stale; I'm in the process of documenting batched/async log4net writes in the README, however :-)