logixia 1.11.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +59 -33
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/index.d.mts +1 -1
  4. package/dist/index.d.mts.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +2 -2
  8. package/dist/index.mjs +2 -2
  9. package/dist/{logitron-logger.module-DHFampon.js → logitron-logger.module-CLfa-Hbx.js} +52 -15
  10. package/dist/logitron-logger.module-CLfa-Hbx.js.map +1 -0
  11. package/dist/{logitron-logger.module-QYBy_Kkq.mjs → logitron-logger.module-CgxjNLRi.mjs} +52 -15
  12. package/dist/logitron-logger.module-CgxjNLRi.mjs.map +1 -0
  13. package/dist/{logitron-logger.module-DGwNfjBX.d.mts → logitron-logger.module-Je6hozHh.d.mts} +13 -3
  14. package/dist/logitron-logger.module-Je6hozHh.d.mts.map +1 -0
  15. package/dist/{logitron-logger.module-DfyBsT_K.d.ts → logitron-logger.module-VhxcmlZZ.d.ts} +13 -3
  16. package/dist/logitron-logger.module-VhxcmlZZ.d.ts.map +1 -0
  17. package/dist/nest.d.mts +1 -1
  18. package/dist/nest.d.ts +1 -1
  19. package/dist/nest.js +2 -2
  20. package/dist/nest.mjs +2 -2
  21. package/dist/{transport.manager-Cij_sA-b.mjs → transport.manager-DETpXuaY.mjs} +56 -13
  22. package/dist/transport.manager-DETpXuaY.mjs.map +1 -0
  23. package/dist/{transport.manager-B9LF9uDd.js → transport.manager-ciG4r5uz.js} +56 -13
  24. package/dist/transport.manager-ciG4r5uz.js.map +1 -0
  25. package/dist/transports.d.mts +14 -2
  26. package/dist/transports.d.mts.map +1 -1
  27. package/dist/transports.d.ts +14 -2
  28. package/dist/transports.d.ts.map +1 -1
  29. package/dist/transports.js +1 -1
  30. package/dist/transports.mjs +1 -1
  31. package/package.json +44 -4
  32. package/dist/logitron-logger.module-DGwNfjBX.d.mts.map +0 -1
  33. package/dist/logitron-logger.module-DHFampon.js.map +0 -1
  34. package/dist/logitron-logger.module-DfyBsT_K.d.ts.map +0 -1
  35. package/dist/logitron-logger.module-QYBy_Kkq.mjs.map +0 -1
  36. package/dist/transport.manager-B9LF9uDd.js.map +0 -1
  37. package/dist/transport.manager-Cij_sA-b.mjs.map +0 -1
package/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # logixia
2
2
 
3
3
  <p align="center">
4
- <strong>The async-first logging library that ships complete.</strong><br/>
5
- TypeScript-first &middot; Non-blocking by design &middot; NestJS &middot; Database &middot; Cloud &middot; Tracing &middot; OTel &middot; Browser
4
+ <strong>The async-first TypeScript logger that ships complete.</strong><br/>
5
+ Wide events &middot; OpenTelemetry (OTLP) &middot; Runtime log levels &middot; Redaction &middot; Adaptive sampling<br/>
6
+ NestJS &middot; Express &middot; Fastify &middot; Database &middot; Cloud &middot; Tracing &middot; Prometheus &middot; Browser
6
7
  </p>
7
8
 
8
9
  <p align="center">
@@ -163,45 +164,70 @@ logixia takes a different approach: **everything ships built-in, and nothing blo
163
164
 
164
165
  ## Feature comparison
165
166
 
166
- | Feature | **logixia** | pino | winston | bunyan |
167
- | ------------------------------------ | :---------: | :---------: | :-----------------------: | :-----: |
168
- | TypeScript-first | yes | partial | partial | partial |
169
- | Async / non-blocking writes | yes | no | no | no |
170
- | NestJS module (built-in) | yes | no | no | no |
171
- | Database transports (built-in) | yes | no | no | no |
172
- | Cloud transports (CW, GCP, Azure) | yes | no | no | no |
173
- | File rotation (built-in) | yes | pino-roll | winston-daily-rotate-file | no |
174
- | Multi-transport concurrent | yes | no | yes | no |
175
- | Log search | yes | no | no | no |
176
- | Field redaction (built-in) | yes | pino-redact | no | no |
177
- | Request tracing (AsyncLocalStorage) | yes | no | no | no |
178
- | Kafka + WebSocket trace interceptors | yes | no | no | no |
179
- | Correlation ID propagation | yes | no | no | no |
180
- | Browser / Edge / Bun / Deno support | yes | partial | no | no |
181
- | OpenTelemetry / W3C headers | yes | no | no | no |
182
- | Graceful shutdown / flush | yes | no | no | no |
183
- | Custom log levels | yes | yes | yes | yes |
184
- | Adaptive log level (NODE_ENV) | yes | no | no | no |
185
- | Plugin / extension API | yes | no | no | no |
186
- | Prometheus metrics extraction | yes | no | no | no |
187
- | Visual TUI log explorer | yes | no | no | no |
188
- | Actively maintained | yes | yes | yes | no |
167
+ | Feature | **logixia** | pino | winston | bunyan |
168
+ | ------------------------------------- | :---------: | :---------: | :-----------------------: | :-----: |
169
+ | TypeScript-first | yes | partial | partial | partial |
170
+ | Async / non-blocking writes | yes | no | no | no |
171
+ | NestJS module (built-in) | yes | no | no | no |
172
+ | Database transports (built-in) | yes | no | no | no |
173
+ | Cloud transports (CW, GCP, Azure) | yes | no | no | no |
174
+ | File rotation (built-in) | yes | pino-roll | winston-daily-rotate-file | no |
175
+ | Multi-transport concurrent | yes | no | yes | no |
176
+ | Log search | yes | no | no | no |
177
+ | Field + message redaction (built-in) | yes | pino-redact | no | no |
178
+ | Request tracing (AsyncLocalStorage) | yes | no | no | no |
179
+ | Kafka + WebSocket trace interceptors | yes | no | no | no |
180
+ | Correlation ID propagation | yes | no | no | no |
181
+ | Browser / Edge / Bun / Deno support | yes | partial | no | no |
182
+ | OpenTelemetry / W3C headers | yes | no | no | no |
183
+ | **OTLP logs export (OTel-native)** | **yes** | transport | no | no |
184
+ | **Wide events / canonical log lines** | **yes** | no | no | no |
185
+ | **Runtime log-level reconfig** | **yes** | external | no | no |
186
+ | **Adaptive (anomaly) sampling** | **yes** | no | no | no |
187
+ | Graceful shutdown / flush (no loss) | yes | partial | no | no |
188
+ | Custom log levels | yes | yes | yes | yes |
189
+ | Adaptive log level (NODE_ENV) | yes | no | no | no |
190
+ | Plugin / extension API | yes | no | no | no |
191
+ | Prometheus metrics extraction | yes | no | no | no |
192
+ | Visual TUI log explorer | yes | no | no | no |
193
+ | Actively maintained | yes | yes | yes | no |
189
194
 
190
195
  ---
191
196
 
192
197
  ## Performance
193
198
 
194
- logixia uses `fast-json-stringify` (a pre-compiled serializer) for JSON output, which is ~59% faster than `JSON.stringify`. The hot path — level check, redaction decision, and format is optimised with pre-built caches built once on construction, not on every log call.
199
+ logixia is async-first and built for the hot path: a synchronous fast path for in-process transports (no Promise allocated when the write completes synchronously), a millisecond-cached timestamp, lazy formatting (each transport formats onceno wasted pre-format), and per-call work (level check, namespace resolution, redaction decision) served off pre-built caches. The result: logixia **beats pino on 5 of 6 real-world scenarios**, beats winston and bunyan across the board, and keeps **p99 latency at 1–3µs** with no tail spikes.
195
200
 
196
- | Library | Simple log (ops/sec) | Structured log (ops/sec) | Error log (ops/sec) | p99 latency |
197
- | ----------- | -------------------: | -----------------------: | ------------------: | -----------: |
198
- | pino | 1,258,000 | 630,000 | 390,000 | 2.5–12µs |
199
- | **logixia** | **840,000** | **696,000** | **654,000** | **4.8–10µs** |
200
- | winston | 738,000 | 371,000 | 433,000 | 9–16µs |
201
+ Benchmarked against **pino, winston, and bunyan** — all writing to `/dev/null` (pure serialization + framework overhead, no disk/terminal cost). Node 20, Apple M-series; numbers are ops/sec, higher is better. Reproduce with `npm run benchmark`.
201
202
 
202
- logixia is **10% faster than pino on structured logging** and **68% faster on error serialization**. It beats winston across the board. Pino leads on simple string logs because it uses synchronous direct writes to `process.stdout` — a trade-off that blocks the event loop under heavy I/O and disappears as soon as you add real metadata.
203
+ | Scenario | pino | **logixia** | winston | bunyan |
204
+ | ------------------------------ | --------: | ------------: | --------: | ------: |
205
+ | Simple string log | 3,220,000 | 2,769,000 | 1,577,000 | 707,000 |
206
+ | **Structured log (5 fields)** | 1,319,000 | **1,536,000** | 699,000 | 536,000 |
207
+ | **Error object logging** | 907,000 | **1,940,000** | 1,062,000 | 573,000 |
208
+ | **Child / per-request logger** | 1,093,000 | **1,436,000** | 321,000 | 380,000 |
209
+ | **Deep nested object** | 891,000 | **1,040,000** | 435,000 | 442,000 |
210
+ | **High-cardinality (12 flds)** | 651,000 | **1,027,000** | 316,000 | 404,000 |
203
211
 
204
- To reproduce: `node benchmarks/run.mjs`
212
+ **What this means:**
213
+
214
+ - ✅ **logixia is faster than pino on 5 of 6 scenarios** — including **+114% on error logging**, **+58% on high-cardinality**, **+31% on child loggers**, and **+16% on structured logs** — the shapes that dominate real production traffic.
215
+ - ✅ **logixia beats winston and bunyan in every scenario**, often by 2–3×, and avoids their tail-latency spikes (winston hit **3,038µs p99** on high-cardinality and **412µs** on deep objects; logixia stays **1–3µs p99** throughout).
216
+ - ⚖️ **pino still wins the trivial simple-string case** (−14%) because it writes synchronously straight to `process.stdout` — fast in a microbenchmark, but it blocks the event loop under real I/O and is exactly the path behind pino's open [flush-on-exit log-loss bug](#graceful-shutdown). logixia stays non-blocking and guarantees delivery, and pulls ahead the moment you log anything structured.
217
+
218
+ **Distinctive-feature throughput** (no cross-library equivalent — `npm run benchmark:features`):
219
+
220
+ | Operation | ops/sec | p99 |
221
+ | ---------------------------------------- | --------: | ----: |
222
+ | Wide event (accumulate 6 fields + emit) | 742,000 | 3.7µs |
223
+ | `safeStringify` (BigInt + circular) | 2,735,000 | 0.5µs |
224
+ | `decycle` + `retrocycle` round-trip | 1,003,000 | 1.3µs |
225
+ | Adaptive-sampling decision (hot path) | 1,950,000 | 0.9µs |
226
+ | Namespace child logging (`db.*` → debug) | 1,966,000 | 0.8µs |
227
+
228
+ Sampling and namespace resolution add **negligible overhead** (~µs), so you can keep them on in production.
229
+
230
+ To reproduce: `npm run benchmark` (core) and `npm run benchmark:features` (distinctive APIs).
205
231
 
206
232
  ---
207
233