Lurgle.Logging now supports Splunk!

Lurgle.Logging until now has supported just the File, Windows Event Log, Seq, and Console log types. It was always the intent to extend this to other log types to support the overall intent of Lurgle - accelerating and enhancing structured logging in your projects by leveraging the excellent work of the Serilog community.

I hadn't got around to adding Splunk, because Seq fulfilled our needs for structured logging. I love Seq, but if you already have Splunk, you can readily send structured logs here via a HTTP Event Collector configured for Json. If you had both, you could send to both simultaneously!

This is really a straightforward addition. All it really took was to set up a Splunk instance on my machine for testing, and a small amount of code.

To make use of Splunk as a log type is just as easy. If you're using app.config, you can simply specify;

<add key="LogSplunkHost" value="https://splunk.domain.com/services/collector" />
<add key="LogSplunkToken" value="yourtokenhere" />

and of course via a constructor:

Logging.SetConfig(new LoggingConfig(Logging.Config, logSplunkHost: "https://splunk.domain.com/services/collector", logSplunkToken: "yourtokenhere"));

As with the other log types, there is a LogLevelSplunk setting that allows you to set the minimum log level for the Splunk sink.

I have set the Splunk sink to use the same proxy settings as Seq - so even if you don't use Seq, if you need to set proxy settings for your application to reach Splunk, use the LogSeqUseProxy, LogSeqProxyServer, etc, values.

This is available on Nuget now!

Comments

You may also like:

Lurgle.Logging v1.2.1 - More logging patterns for your Lurgle convenience

Lurgle approach compared to Serilog Following on from the v1.2.0 multi-threaded correlation release, I thought about whether we could further improve how we interface with Lurgle.Logging. The general approach was to maintain a static interface to logging that would allow us to capture key properties for logging, that would provide nicely...

Lurgle.Logging v1.2.0 - Multi-threaded correlation ids are now a thing

Multi-threaded correlation ids were not a thing Following on from my work on Seq.Client.WindowsLogins and the subsequent realisation that EventLog's EntryWritten event handler is bad and should feel bad, I contemplated whether I could apply some of my efforts to solve another issue that had been bugging me. Lurgle.Logging was...

Lurgle.Logging - a standardised Serilog implementation with extra goodies!

Logging is important Logging is a really important, oft-neglected, aspect of business applications. I can't state that enough. If you don't have good logging, you can't troubleshoot and debug problems, and you have little chance of seeing what's actually going on in your enterprise. In Structured Logging with Seq and Serilog,...