QuickLog.net is a simple .NET logging library
It supports logging:
- to the console
- to a file
- Dependency injection via
AddQuickLog(...) - Basic log levels (
Trace, `Error``) - Console output with timestamp
- File output with automatic directory creation
- .NET
10.0
Configure it with DI:
using QuickLog.net;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddQuickLog(options =>
{
options.EnableConsoleLogging = true;
options.EnableFileLogging = true;
options.FileLoggingPath = "logs/exemple";
options.AddDateToFileFormat = true;
});Available options:
EnableConsoleLogging(bool?): enables/disables console logging (defaulttrue)EnableFileLogging(bool?): enables/disables file logging (defaultfalse)FileLoggingPath(string?): log file path (for examplelogs/exemple)AddDateToFileFormat(bool?): enables/diasble date at the end of the file (for examplelogs/exemple260311.log)
Inject the logger:
using QuickLog.net.Logging;
public class App
{
private readonly IQuickLog _quickLog;
public App(IQuickLog quickLog)
{
_quickLog = quickLog;
}
public void Run()
{
_quickLog.LogTrace("Application started");
_quickLog.LogError("This is a sample error log");
}
}Each line is written using this format:
[yyyy-MM-dd HH:mm:ss] [LogType] message
Example:
[2026-03-10 14:30:12] [Trace] Application started
To write logs to a file, you must:
- set
EnableFileLogging = true - set
FileLoggingPath
Valid example:
services.AddQuickLog(options =>
{
options.EnableConsoleLogging = true;
options.EnableFileLogging = true;
options.FileLoggingPath = "logs/exemple";
});The directory is created automatically if needed.
From the solution root:
dotnet run --project Exemple/Exemple.csprojThe file will be created here:
Exemple/logs/quicklog.log
QuickLog.net/Logging/QuickLog.cs: logger implementationQuickLog.net/Logging/IQuickLog.cs: logger contractQuickLog.net/Model/QuickLogOption.cs: configuration optionsQuickLog.net/DI/ServiceCollectionExtension.cs:AddQuickLogextensionExemple/Program.cs: usage example