-
bit-log 2.0.0
Stablereleased this
2026-08-15 13:36:31 +00:00 | 0 commits to main since this releasebit-log 2.0.0 moves the project to Node.js 24 and native ESM while making appender lifecycle, shutdown, and I/O behaviour deterministic.
Highlights
- Add
closeLogging()to await queued File and SQLite operations during application shutdown. - Reuse unchanged appenders and close replaced instances automatically during reconfiguration.
- Serialize SQLite initialization, writes, and shutdown to prevent connection races and lost queued events.
- Use configurable SQLite journal and synchronization modes, defaulting to
WALwithNORMAL. - Cache validated FileAppender paths while preserving validation retries after failures.
- Prevent repeated File and SQLite failures from flooding process error output.
- Normalize string levels on externally emitted events and warn about unknown appender properties.
Performance
Local benchmarks showed approximately:
- 2× higher FileAppender throughput through successful path-validation caching.
- 12× higher SQLiteAppender throughput through WAL, prepared statements, and serialized writes.
Actual results depend on the runtime and storage environment.
Migrating from v1
- Node.js 24 or newer is required. Applications on older Node.js releases should remain on bit-log 1.x.
- The package is distributed as native ESM with TypeScript declarations and explicit package exports.
- SQLite now defaults to
WAL, creating temporary-waland-shmfiles next to the database. - Configure SQLite with
journalMode: 'DELETE'on NFS, SMB, or other network file systems. - Unchanged appender configurations now reuse their existing instances.
- Unknown appender configuration properties now produce warnings.
- Custom appender
close()implementations must be idempotent and allow later reuse.
See the migration guide and changelog for details.
Validation
- 291 tests
- 100% statement, branch, function, and line coverage
- Native ESM package verified from TypeScript and runtime consumer entry points
Implemented in PR #68.
Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download
- Add