PeriodicLogger 1.0.0
dotnet add package PeriodicLogger --version 1.0.0
NuGet\Install-Package PeriodicLogger -Version 1.0.0
<PackageReference Include="PeriodicLogger" Version="1.0.0" />
paket add PeriodicLogger --version 1.0.0
#r "nuget: PeriodicLogger, 1.0.0"
// Install PeriodicLogger as a Cake Addin #addin nuget:?package=PeriodicLogger&version=1.0.0 // Install PeriodicLogger as a Cake Tool #tool nuget:?package=PeriodicLogger&version=1.0.0
---Add these Appsettings:
"LogTracker": { "OrganizationId": "aec74b36-d2da-4cd4-9cd1-abde7d23553c", "ApplicationId": "f0d91e36-95c6-42fd-93be-2b2e7bc066d0", "ApiUrl": "http://localhost:5006/" }, "Seq": { "SeqServerUrl": "http://host.docker.internal:5341", "SeqApiKey": "FcUQ9ujzJGvFK7gvRkrj" }, "PeriodicLogger": { "SyncIntervalMinutes": 5 },
---region Register Logger // Create a level switch for controlling logging levels var levelSwitch = new LoggingLevelSwitch();
// Configure Serilog for real-time file logging with date in file name Log.Logger = new LoggerConfiguration() .MinimumLevel.ControlledBy(levelSwitch) .Enrich.FromLogContext() .Enrich.WithProperty("ApplicationName", builder.Environment.ApplicationName) .Enrich.WithProperty("EnvironmentName", builder.Environment.EnvironmentName) .WriteTo.Console() .WriteTo.File("logs/log-.txt", rollingInterval: RollingInterval.Day) // Real-time file logging with date .CreateLogger();
builder.Host.UseSerilog(Log.Logger);
---Register Dependencies builder.Services.AddHostedService<PeriodicLoggerService>(); // Register the background service for periodic logging builder.Services.AddSingleton(levelSwitch); // Register LoggingLevelSwitch as a singleton service
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Serilog (>= 3.1.1)
- Serilog.Sinks.Seq (>= 7.0.1)
- SLS.TRACKER.LOGGER (>= 1.0.0)
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 |
---|---|---|
1.0.0 | 111 | 6/6/2024 |