A lightweight, customizable file logger provider for Microsoft.Extensions.Logging with async processing and JSON support.
Karambolo.Extensions.Logging.File is a file logger provider implementation for the Microsoft.Extensions.Logging framework. It enables applications to log messages to files with features like asynchronous processing, JSON structured logging, and flexible configuration. It solves the need for a lightweight, dependency-free file logging solution within the standard .NET logging ecosystem.
Developers building .NET Core, ASP.NET Core, or .NET 5+ applications who need reliable file logging integrated with Microsoft.Extensions.Logging. It's particularly useful for those requiring customizable log formats, rotation, or structured JSON output.
Developers choose this library because it offers a full-featured, async file logger with zero third-party dependencies, seamless integration with the standard logging framework, and extensive customization options for advanced use cases like log rotation and custom formatters.
A lightweight and customizable file logger implementation for the Microsoft.Extensions.Logging framework.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements the complete feature set of Microsoft's ConsoleLogger, including log scopes and configuration reloading, ensuring seamless integration with the standard logging framework.
Log messages are processed in the background to prevent I/O blocking, with guaranteed writes on graceful shutdown, as highlighted in the README for high-volume scenarios.
The library has no third-party dependencies, reducing package bloat and compatibility issues, which is emphasized as a core philosophy.
Supports hierarchical log file settings, path templates with date/counter placeholders, and fine-grained filtering, allowing detailed control over logging behavior.
For non-ASP.NET Core projects, explicit references to framework libraries are required to avoid outdated versions, adding setup complexity as admitted in the installation notes.
While achievable through customization, log rotation is not provided out of the box, requiring additional implementation effort, as noted in the samples section.
The README warns that multiple file definitions with the same Path can lead to erroneous behavior, and troubleshooting steps are needed for common issues like missing log files.