Skip to content
/ LogPot Public

A modern logging library for TypeScript with custom levels, worker-thread offloading, fully customizable templates, and built-in transports featuring file rotation, retention, batching, compression, HTTP authentication (OAuth2, Basic, ...) and more.

License

Notifications You must be signed in to change notification settings

koculu/LogPot

LogPot

npm version License: MIT Docs

A modern logging library for TypeScript with custom levels, worker-thread offloading, fully customizable templates, and built-in transports featuring file rotation, retention, batching, compression, HTTP authentication (OAuth2, Basic, ...) and more.

🔥 Why LogPot?

  • ✅ Type‑Safe & Structured
    Every entry is a plain object (msg, level, time, meta), giving you compile‑time guarantees and smooth downstream processing.

  • 🔌 Pluggable Transports
    Console, File (rotation, batching, retries), HTTP (OAuth2, Bearer, API‑Key) or roll your own by extending Transport.

  • 🎨 Rich Formatting
    JSON‑array, NDJSON, envelope or fully‑templated text: padding, truncation, colors, emojis, custom hooks.

  • 🐞 Robust Error Serialization
    Turn Error, nested cause chains, and AggregateError into safe, circular‑free JSON with optional stacks & hooks.

  • ⚙️ Fine‑Grained Control
    Filters, transformers, custom level maps, categories, gzip, merge‑meta—everything you need to tailor your pipeline.

  • 🧵 Worker‑Thread Offloading
    Push transport specific tasks to background threads so your main loop stays rock‑solid.


🛠️ Quick Start

npm install logpot
# or
yarn add logpot
import { createLogger, getLogger } from 'logpot'

// 1️⃣ Initialize
await createLogger()

// 2️⃣ Use it
const logger = getLogger()
logger.info('Server started', { port: 8080 })
logger.error(new Error('Database connection failed'))

// 3️⃣ Graceful shutdown
await logger.close()

📚 Documentation & Community


💖 Sponsorship

Funding open-source helps us maintain and improve LogPot. If you find LogPot valuable, please consider sponsoring its development:

Your support keeps the library up‑to‑date, secure, and feature‑rich for everyone!


🤝 Contributing

We welcome issues, PRs, and feature requests! Please see CONTRIBUTING.md for guidelines.


📄 License

Released under the MIT License.

About

A modern logging library for TypeScript with custom levels, worker-thread offloading, fully customizable templates, and built-in transports featuring file rotation, retention, batching, compression, HTTP authentication (OAuth2, Basic, ...) and more.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published