SunAuto.Splunk.Client 2.0.2

Suggested Alternatives

SunAuto.Logging

Additional Details

The same asynchronous logging queue, but in a new AI generated package!

dotnet add package SunAuto.Splunk.Client --version 2.0.2
                    
NuGet\Install-Package SunAuto.Splunk.Client -Version 2.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SunAuto.Splunk.Client" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SunAuto.Splunk.Client" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SunAuto.Splunk.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SunAuto.Splunk.Client --version 2.0.2
                    
#r "nuget: SunAuto.Splunk.Client, 2.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SunAuto.Splunk.Client@2.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SunAuto.Splunk.Client&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=SunAuto.Splunk.Client&version=2.0.2
                    
Install as a Cake Tool

Sun Auto Splunk.NET

A .NET library in a NuGet package allowing convenient logging to Splunk using dependency injection and Microsoft Logging Extensions.

Get Started

Install the NuGet package

  • Open https://dev.azure.com/SunAuto/Pipelines/_artifacts/feed/SunAuto/connect in the browser, and follow the instructions for Visual Studio.
  • Reference the package in your .NET assembly
  • Use package management that is built in w/ Visual Studio making sure that VS is set to see at least the Sun Auto feed, or use the command line: Install-Package SunAuto.Logging.

Configure the logger

In your application's settings file (e.g., appsettings.json), add the following JSON object in the Logging section adjusting your logging levels according to your needs:

 "Logging": {
   "LogLevel": {
     "Default": "Information",
     "Microsoft.AspNetCore": "Warning"
   },
   "SunAuto": {
     "Source": <Name of this resource/API>,
     "BaseUrl": <Base URL from Splunk>,
     "Token": <Splunk token>,
     "LogLevel": {
       "Default": "Information",
       "Microsoft.Hosting": "Warning"
     }
   }
 },

Inject the logger

In the start-up program file, add the following lines:

using SunAuto.Logging.Client;

builder.Logging.AddSplunkLogging(configuration);

Use the ClearProviders() method only if you don't want any other loggers used.

Use the Logger

Add the ILoggerFactory logger parameter to any of the service-managed classes (e.g. controllers, etc.)

public class MyClass(ILoggerFactory logger)
{
   ILogger<MyClass> _Logger = logger.CreateLogger<MyClass>();
}

Then use the built in logging extension methods to create log entries:

_Logger.LogWarning(exception, "I'm warning you that there is an exception.");

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

References

Support

If you like this project and think it has helped in any way, consider getting tires or auto service at a Sun Auto Tire & Service location near you:

<a href="https://sun.auto/home" target="_blank"><img src="https://sun.auto/wp-content/themes/sun-auto/images/logo_sunauto.png" alt="Sun Auto Tire & Service" width="150" height="65"/></a>

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 759 8/1/2025 2.0.2 is deprecated because it is no longer maintained.
2.0.2-preview 129 8/1/2025
2.0.1-preview 139 8/1/2025

Migrating to opensource on Github!.