Zero-alloc structured logging for .NET — fast formatters, rich terminal visuals, production-ready file & JSON sinks.
$ dotnet add package XenoAtom.Logging
XenoAtom.Logging is a high-performance structured logging runtime for .NET, designed for zero allocations on the hot path and predictable throughput in both sync and async modes. It includes a high-efficiency interpolated logging API, structured properties/scopes, source-generated formatters, and production-grade file/JSON sinks.
Trace/Debug/Info/Warn/Error/Fatal)Span<char> with pooled buffers and optional segment metadataDrop, DropAndNotify, Block, Allocate)LogProperties)BeginScope) captured as snapshotsLogFormatter base class with shared settings (LevelFormat, TimestampFormat)StandardLogFormatter) and segment kinds for rich sinksSystem.Console:
XenoAtom.Logging.Terminal uses XenoAtom.Terminal for markup-aware outputTerminalLogControlWriter targets XenoAtom.Terminal.UI.Controls.LogControl for fullscreen/log-viewer appsXenoAtom.Terminal.UI.Visual (tables, layouts, rich widgets)FileLogWriter, JsonFileLogWriter)LogManagerConfig.AsyncErrorHandlerLogManager.GetDiagnostics() (DroppedMessages, ErrorCount)IsAotCompatible, IsTrimmable)
And the integration with LogControl:

[!NOTE] XenoAtom.Logging does not aim to be compatible with
Microsoft.Extensions.Loggingtoday. A bridge may be added later, but the runtime is designed to stand on its own.
XenoAtom.Logging targets net10.0 and requires the .NET 10 SDK (C# 14).
dotnet add package XenoAtom.Logging
dotnet add package XenoAtom.Logging.Terminal
XenoAtom.Logging: core runtime, formatters, stream/file/JSON writersXenoAtom.Logging also ships the generators/analyzers in-package (analyzers/dotnet/cs)XenoAtom.Logging.Terminal: terminal sink using XenoAtom.Terminal and XenoAtom.Terminal.UIusing XenoAtom.Logging;
using XenoAtom.Logging.Writers;
var config = new LogManagerConfig
{
RootLogger =
{
MinimumLevel = LogLevel.Info,
Writers =
{
new FileLogWriter(
new FileLogWriterOptions("logs/app.log")
{
FileSizeLimitBytes = 10 * 1024 * 1024,
RollingInterval = FileRollingInterval.Daily,
RetainedFileCountLimit = 7
})
}
}
};
LogManager.Initialize(config); // sync processor by default
var logger = LogManager.GetLogger("Sample");
logger.Info($"Hello {42}");
LogManager.Shutdown();
Enable async processing:
config.AsyncErrorHandler = exception =>
{
Console.Error.WriteLine($"[logging async error] {exception}");
};
LogManager.InitializeForAsync(config);
Markup payload logging (terminal sink):
logger.InfoMarkup("[green]ready[/]");
logger.ErrorMarkup($"[bold red]failed[/] id={requestId}");
Visual attachments via XenoAtom.Terminal.UI (rendered under the log line by TerminalLogWriter):
using XenoAtom.Terminal.UI;
using XenoAtom.Terminal.UI.Controls;
var table = new Table()
.Headers("Step", "Status", "Duration")
.AddRow("Initialize", "OK", "00:00.045")
.AddRow("ProcessRequest", "FAILED", "00:00.003");
logger.Info(table, "Run summary");
logger.InfoMarkup(table, "[bold]Run summary (styled)[/]");
TerminalLogWriter and TerminalLogControlWriter both expose Styles and SegmentStyleResolver for per-segment and per-level styling.
LogManager and Logger are safe for concurrent logging.LogManagerConfig, LoggerConfig.Writers, and writer filter collections from a single thread, then call ApplyChanges() when done.LogProperties is a mutable value type; avoid copying populated instances and dispose only the owner instance.AsyncErrorHandler + diagnostics to observe failures.See the thread-safety documentation at https://xenoatom.github.io/logging/docs/thread-safety/.
Full documentation is available at https://xenoatom.github.io/logging/docs.
This software is released under the BSD-2-Clause license.
Alexandre Mutel aka xoofx.