Production debugging comparisons

ArgusLogs vs traditional logging libraries

Architectural and feature comparison of ArgusLogs against Serilog, NLog, log4net, and Microsoft.Extensions.Logging — including a head-to-head BenchmarkDotNet run.

Fair, factual comparisons for .NET teams — no competitor bashing. Each page explains what the other tool is, where it is stronger, and where ArgusLogs fits for production debugging.

Section 2 of 5 Logging libraries

Dimension by dimension

A. Code cleanliness & code pollution (boilerplate)

Traditional logging (Serilog / NLog) requires injecting ILogger<T> into every constructor. Methods need manual log calls at start, exit, and catch blocks — often 20–30% of a method body.

Traditional — ProcessOrder.cs
public Order ProcessOrder(OrderRequest req) {
    _logger.LogInformation("Processing order for customer {Id}", req.CustomerId);
    try {
        var res = _db.Save(req);
        _logger.LogInformation("Order processed successfully. Order ID: {Id}", res.Id);
        return res;
    } catch (Exception ex) {
        _logger.LogError(ex, "Failed to process order for customer {Id}", req.CustomerId);
        throw;
    }
}

ArgusLogs — zero pollution

Apply a single declarative [LogMethod] at class or method level. The post-build weaver injects boundary telemetry (parameters, exceptions, durations) automatically.

ArgusLogs — ProcessOrder.cs
[LogMethod]
public Order ProcessOrder(OrderRequest req) {
    return _db.Save(req); // Core logic stays 100% clean
}

B. Logical context propagation (trace correlation)

  • Traditional — Correlating an HTTP request with nested DB queries and API calls needs BeginScope or manual ThreadLocal / AsyncLocal tracking.
  • ArgusLogs — Built-in ArgusLogsContext propagates correlation IDs, parent/child structure, and cross-thread async boundaries out of the box.

C. Database & outbound network interception

  • Traditional — Requires separate third-party packages (EF interceptors, custom HttpMessageHandlers) plus custom formatting code.
  • ArgusLogs — Native ArgusLogs.DatabaseTracker and ArgusLogs.NetworkTracker modules.
  • Database — EF Core and raw ADO.NET / Dapper: SQL text, parameters, latency, caller context.
  • Network — Outbound HttpClient via DiagnosticListener — no custom delegating handlers in app code.

D. Performance & memory allocation

  • Traditional — Runtime template formatting and scope allocations can churn memory and pressure GC under high throughput.
  • ArgusLogs — Compile-time interception injects static calls (no runtime reflection). Telemetry flushes asynchronously through an optimized LogManager background buffer.