DynamicLogger 1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DynamicLogger --version 1.0.0
NuGet\Install-Package DynamicLogger -Version 1.0.0
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="DynamicLogger" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DynamicLogger" Version="1.0.0" />
<PackageReference Include="DynamicLogger" />
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 DynamicLogger --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DynamicLogger, 1.0.0"
#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 DynamicLogger@1.0.0
#: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=DynamicLogger&version=1.0.0
#tool nuget:?package=DynamicLogger&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DynamicLogger
A modern, minimal, and dynamic logging library for ASP.NET Core and .NET applications. Easily manage and change log levels at runtime for fine-grained logging control.
Features
- Dynamic log level adjustment for categories via API endpoint or code.
- Minimal API ready extension for fast integration.
- Configurable via swagger-exposed endpoints.
- Supports Microsoft.Extensions.Logging abstractions.
Getting Started
1. Install via NuGet
dotnet add package DynamicLogger
2. Register Services
In your Program.cs or Startup.cs:
// Register DynamicLogger services
builder.Services.AddLoggerServices();
3. Add DynamicLogger Endpoint
For Minimal API:
app.MapLoggerEndpoint();
Example:
Sets log level for the default category:
POST /logging/setlevel/{level}
Body: { "level": "Information" }
Usage Example
// Change log level for category
DynamicLogger.SetLogLevel("Default", LogLevel.Debug);
Swagger Integration
Endpoints added via your library are auto-detected by Swagger/OpenAPI:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
app.MapLoggerEndpoint();
app.UseSwagger();
app.UseSwaggerUI();
License
MIT
Author
Created by IoJo
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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.
-
net9.0
- Microsoft.AspNetCore.Routing (>= 2.3.0)
- Microsoft.AspNetCore.Routing.Abstractions (>= 2.3.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Logging.Console (>= 9.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.