Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jterral/extensions-telemetry
Extensions for Telemetry configuration.
https://github.com/jterral/extensions-telemetry
nuget telemetry
Last synced: 22 days ago
JSON representation
Extensions for Telemetry configuration.
- Host: GitHub
- URL: https://github.com/jterral/extensions-telemetry
- Owner: jterral
- License: mit
- Created: 2025-01-16T10:52:47.000Z (25 days ago)
- Default Branch: main
- Last Pushed: 2025-01-17T15:25:07.000Z (23 days ago)
- Last Synced: 2025-01-17T16:44:07.972Z (23 days ago)
- Topics: nuget, telemetry
- Language: C#
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Extensions Telemetry
## 📝 Overview
This NuGet package provides telemetry capabilities for your applications by configuring Serilog with defined parameters.
## 📦 Installation
To install the package, run the following command in the Package Manager Console:
```sh
Install-Package Jootl.Extensions.Telemetry
```## 🚀 Usage
After installing the package, you can start using it by adding the necessary using directive and initializing the telemetry service in your application.
### Configuration
Add section `Jootl` under `Logging` in `appsettings.json`.
```json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
},
"Jootl": {
"ApplicationName": "MyWebApplication",
"Seq": {
"ApiUrl": "http://192.168.1.1:8080",
"ApiKey": "__MY_API_KEY__"
}
}
},
}
```### For Web/Api
```csharp
using Jootl.Extensions.Telemetry;// ...
var builder = WebApplication.CreateBuilder(args);
// ...// Add custom logging to the Host
builder.Host.AddCustomLogging();// ...
var app = builder.Build();
// ...// Use custom logging capabilities
app.UseCustomLogging();
```### For Worker
```csharp
using Jootl.Extensions.Telemetry;// ...
var builder = Host.CreateApplicationBuilder(args);
// ...// Add custom logging to the services
builder.Services.AddCustomLogging(builder.Configuration);
```## ✨ Features
- Configure Serilog as primary logging provider
- If Seq is enabled, send logs to the server## 📄 License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.