Repository navigation
v3.0.0
v3.0.0 — Major release: package rename + HFT-grade rewrite
Ozakboy.NLOGv2.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. Allusingstatements in consumer code must be updated. - Removed TargetFrameworks: dropped
.NET Framework 4.6.2,net6.0,net7.0(all EOL). Now supportsnetstandard2.0,netstandard2.1,net8.0,net9.0,net10.0. - Enum typo fixed:
LogLevel.CostomName→LogLevel.CustomName. The public methodLOG.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(defaultfalse) — opt-in subscription toAppDomain.UnhandledExceptionandTaskScheduler.UnobservedTaskException, auto-logs at Fatal level.MaxOpenFileStreams(default100) — LRU upper bound.DiskFlushIntervalMs(default100) — periodic flush interval for persistent FileStreams.OnDropped(defaultnull) — 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.Formaton 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.cswhereConsole.WriteLine(formattedMessage, args)could throwFormatExceptionif the formatted message coincidentally contained{0}-style tokens. - Auto-flush level selection —
ErrorandFatalnow correctly trigger immediate flush regardless of the caller'simmediateFlushargument.
🛠️ Technical
LogItemchanged from class toreadonly 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
- Full changelog: docs/en/changelog.md · docs/zh-TW/changelog.md
- Migration from v2.x: docs/en/migration.md · docs/zh-TW/migration.md
- Website: https://ozakboy.github.io/OzaLog/
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.