Skip to content

@sylphx/catThe fastest logger for JavaScript

Ultra-lightweight, universal, and production-ready logging for all runtimes

@sylphx/cat

Quick Start ​

bash
npm install @sylphx/cat
bash
bun add @sylphx/cat
bash
pnpm add @sylphx/cat
typescript
import { createLogger, consoleTransport, prettyFormatter } from '@sylphx/cat'

const logger = createLogger({
  level: 'info',
  formatter: prettyFormatter(),
  transports: [consoleTransport()]
})

logger.info('Hello world!', { user: 'kyle' })

What's New in v0.2.0 ​

ðŸ›Ąïļ OWASP 2024 Compliant Security ​

Auto-redact sensitive data with glob patterns and PII detection:

typescript
import { redactionPlugin } from '@sylphx/cat'

const logger = createLogger({
  plugins: [
    redactionPlugin({
      fields: ['password', '*.secret', '**.apiKey'],
      redactPII: true, // Credit cards, SSNs, emails
      preventLogInjection: true
    })
  ]
})

📊 OpenTelemetry Integration ​

Full OTLP export and W3C Trace Context support:

typescript
import { otlpTransport, tracingPlugin } from '@sylphx/cat'

const logger = createLogger({
  transports: [
    otlpTransport({
      endpoint: 'https://otlp-gateway.grafana.net/otlp/v1/logs',
      resourceAttributes: {
        'service.name': 'my-api',
        'service.version': '1.0.0'
      }
    })
  ],
  plugins: [tracingPlugin()]
})

// Sends to Grafana, Datadog, New Relic, AWS CloudWatch, etc.

💰 Tail-Based Sampling ​

Smart sampling saves 40-90% on costs while keeping 100% of errors:

typescript
import { tailSamplingPlugin } from '@sylphx/cat'

const logger = createLogger({
  plugins: [
    tailSamplingPlugin({
      adaptive: true,
      monthlyBudget: 10 * 1024 * 1024 * 1024 // 10 GB/month
    })
  ]
})

// Automatically keeps all errors, slow requests, 5xx responses
// Samples only 1% of successful requests

Why @sylphx/cat? ​

Feature@sylphx/catPinoWinston
Bundle Size8.93 KB11 KB80 KB
Performance25M ops/s15M ops/s5M ops/s
Zero Dependencies✅❌❌
Universal✅❌❌
OpenTelemetry✅Partial❌
W3C Trace Context✅❌❌
OWASP Compliant✅❌❌
Tail Sampling✅❌❌
TypeScript-First✅✅⚠ïļ

Trusted By ​

@sylphx/cat powers logging for production systems handling millions of requests per day.

  • ⚡ Performance: Optimized for speed without compromising features
  • ðŸ›Ąïļ Security: OWASP 2024 compliant with built-in protections
  • 📊 Observability: Full OpenTelemetry integration
  • 💰 Cost-Effective: Smart sampling reduces costs by 40-90%

Get Started →

Released under the MIT License.