Repository navigation
v1.0.0
logfx v1.0.0
The first stable release of logfx. Production-ready logging with 13 official integrations, PII redaction, and zero dependencies. Same API in Node and browser.
Highlights
One logger, two formats
- Pretty output in development (colors, emojis, readable structure)
- Structured JSON in production
- Auto-detected from NODE_ENV, no config
13 integrations (separate packages)
- Datadog, Elasticsearch, Sentry, OpenTelemetry
- AWS CloudWatch, Google Cloud Logging, Azure Monitor
- Slack, Grafana Loki, Papertrail, Splunk
- Honeycomb, Logtail
Production reliability
- Webhook transport: retry with exponential backoff, circuit breaker, dead letter queue, multi-region failover
- File transport: size-based rotation, compression, max files
PII redaction
- Built-in patterns: email, SSN, credit card, phone, IP, JWT
- Custom patterns and key-based redaction
- Masking functions for partial redaction
Framework middleware
- Express:
req.log, request IDs, automatic timing - Fastify: same API
- Next.js:
withLoggingfor API routes
Universal
- Node.js, Bun, Deno
- Browsers (Beacon transport for reliable delivery on page unload)
- Same API everywhere
Quick Start
npm install logfximport { log } from 'logfx'
log.info('Server started', { port: 3000 })
log.error('Something failed', new Error('oops'))What's Included
| Area | Features |
|---|---|
| Core | 5 levels (debug, info, success, warn, error), namespaces, context, lazy evaluation |
| Transports | Console, file, webhook, beacon (browser) |
| Observability | W3C TraceParent, request ID tracking, log sampling |
| Output | Errors serialize with stack traces |
Breaking Changes
Redaction API (if you used redact in v0.5.x):
fields→keysreplacement→censor- New:
patternsfor built-in PII (email, ssn, creditCard, phone, ip, jwt) - New:
pathsfor nested paths (e.g.user.email)
// v0.5.x
redact: { fields: ['password', 'token'], replacement: '***' }
// v1.0.0
redact: { keys: ['password', 'token'], censor: '***' }Core logging API is unchanged. Integrations are new packages. Install only what you need:
npm install logfx logfx-datadogUpgrade from 0.5.x
npm install logfx@^1.0.0If you used redaction, update your config (see Breaking Changes above). Otherwise, existing code works without changes. Add integrations as needed:
npm install logfx-elasticsearch logfx-sentryStats
- Zero dependencies (core)
- ~3KB gzipped
- ESM and CJS
- Full TypeScript support
- CI: tests, typecheck, build on Node 18, 20, 22, 24
- Stress tests: 10k logs in under 1s, 1k with redaction in under 500ms
Integrations (npm)
| Package | Description |
|---|---|
| logfx-datadog | Datadog APM |
| logfx-elasticsearch | Elasticsearch |
| logfx-sentry | Sentry error tracking |
| logfx-otel | OpenTelemetry |
| logfx-cloudwatch | AWS CloudWatch |
| logfx-google-cloud | Google Cloud Logging |
| logfx-azure | Azure Monitor |
| logfx-slack | Slack webhook |
| logfx-loki | Grafana Loki |
| logfx-papertrail | Papertrail |
| logfx-splunk | Splunk HEC |
| logfx-honeycomb | Honeycomb |
| logfx-logtail | Logtail (Better Stack) |
Links
- npm: https://www.npmjs.com/package/logfx
- Documentation: https://github.com/chintanshah35/logfx#readme
- Ecosystem: https://github.com/chintanshah35/logfx#ecosystem-integrations
Full Changelog: v0.5.0...v1.0.0