Skip to content

v3.0.0

Choose a tag to compare

@ozakboy ozakboy released this 09 May 11:53
· 17 commits to main since this release

v3.0.0 — Major release: package rename + HFT-grade rewrite

Ozakboy.NLOG v2.x is now deprecated. Future development happens on OzaLog.
See migration guide (繁中: 升級指南).


⚠️ Breaking Changes

  • Package renamed: Ozakboy.NLOG → OzaLog. The previous package on NuGet is deprecated and points here.
  • Namespace renamed: ozakboy.LOG → OzaLog. All using statements in consumer code must be updated.
  • Removed TargetFrameworks: dropped .NET Framework 4.6.2, net6.0, net7.0 (all EOL). Now supports netstandard2.0, netstandard2.1, net8.0, net9.0, net10.0.
  • Enum typo fixed: LogLevel.CostomName → LogLevel.CustomName. The public method LOG.CustomName_Log(...) was already correctly named — only the underlying enum value was renamed.

✨ Added

  • HFT-grade async pipeline: ConcurrentQueue<struct LogItem> + persistent FileStream pool + 1ms cached timestamp + drop-oldest backpressure.
  • New LogOptions:
    • EnableGlobalExceptionCapture (default false) — opt-in subscription to AppDomain.UnhandledException and TaskScheduler.UnobservedTaskException, auto-logs at Fatal level.
    • MaxOpenFileStreams (default 100) — LRU upper bound.
    • DiskFlushIntervalMs (default 100) — periodic flush interval for persistent FileStreams.
    • OnDropped (default null) — callback invoked when the async queue drops the oldest item under backpressure.
  • xUnit test project (OzaLog.Tests/) covering concurrency, LRU, day rollover, backpressure, GlobalExceptionCapture toggle, and format correctness.
  • BenchmarkDotNet project (OzaLog.Benchmarks/) comparing OzaLog with ZLogger, ZeroLog, and Serilog.

🚀 Improved

  • Zero NuGet dependencies on net8.0 / net9.0 / net10.0 (System.Text.Json built into BCL).
  • Formatting work moved off the calling thread — callers only enqueue raw tuples, no string.Format on the hot path.
  • Persistent FileStreams eliminate per-batch open/close, reducing syscall cost to near-zero.
  • Day rollover handled inline in the dispatcher.
  • Expired-log cleanup moved to a background timer (was on the hot path in v2.x).

🐛 Fixed

  • Double-format bug in LOG.cs where Console.WriteLine(formattedMessage, args) could throw FormatException if the formatted message coincidentally contained {0}-style tokens.
  • Auto-flush level selection — Error and Fatal now correctly trigger immediate flush regardless of the caller's immediateFlush argument.

🛠️ Technical

  • LogItem changed from class to readonly struct — zero GC on the hot path.
  • Build verified across all 5 TargetFrameworks with 0 warnings / 0 errors.

📦 Install

dotnet add package OzaLog --version 3.0.0

🌐 Documentation


Disclaimer: OzaLog is not related to NLog (jkowalski's package). The naming similarity in the previous version (Ozakboy.NLOG) caused confusion — v3.0 renames to OzaLog to make this unambiguous.