SunAuto.Splunk.Client
2.0.2
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
<PackageReference Include="SunAuto.Splunk.Client" Version="2.0.2" />
<PackageVersion Include="SunAuto.Splunk.Client" Version="2.0.2" />
<PackageReference Include="SunAuto.Splunk.Client" />
paket add SunAuto.Splunk.Client --version 2.0.2
#r "nuget: SunAuto.Splunk.Client, 2.0.2"
#:package SunAuto.Splunk.Client@2.0.2
#addin nuget:?package=SunAuto.Splunk.Client&version=2.0.2
#tool nuget:?package=SunAuto.Splunk.Client&version=2.0.2
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
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 | Versions 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.7)
- Microsoft.Extensions.Logging (>= 9.0.7)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.7)
- Microsoft.Extensions.Logging.Console (>= 9.0.7)
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-preview | 129 | 8/1/2025 | |
| 2.0.1-preview | 139 | 8/1/2025 |
Migrating to opensource on Github!.