tslog
tslog is a TypeScript/JavaScript logging library offering pretty console output for development and structured JSON for production. It supports multiple runtimes (Node.js, browsers, Deno, Bun), provides stack trace mapping via source maps, and includes features like secret masking and sub-logger inheritance.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | fullstack-build/tslog |
| Owner | fullstack-build |
| Primary language | TypeScript |
| License | MIT — OSI-approved |
| Stars | 1.6k |
| Forks | 73 |
| Open issues | 13 |
| Latest release | v4.11.0 (2026-07-07) |
| Last updated | 2026-07-07 |
| Source | https://github.com/fullstack-build/tslog |
What tslog is
Universal logger with dual output modes (pretty formatting or JSON), native TypeScript support with source map integration, pluggable transport architecture, circular structure handling, and configurable log levels. Distributed as ESM and CommonJS with tree-shaking support.
Get the tslog source
Clone the repository and explore it locally.
git clone https://github.com/fullstack-build/tslog.gitcd tslog# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Enable source maps explicitly in tsconfig.json (inlineSourceMap or separate maps) and Node.js runtime (--enable-source-maps flag) for accurate stack trace attribution.
- Secret masking via maskValuesOfKeys is recursive but operates at runtime; validate performance on deeply nested or large objects in production.
- Sub-logger inheritance chains settings and fields; trace parent-child logger relationships to avoid unexpected log duplication or filtering.
- Custom transport implementation requires understanding the lifecycle (mask → toLogObj → addMeta → format → transport); ensure error handling in transports does not block main application.
- ESM vs. CommonJS entry points exist; align module strategy with application bundler and ensure correct import paths for tree-shaking benefits.
When to avoid it — and what to weigh
- High-volume, ultra-low-latency logging required — No performance benchmarks provided; impact of masking, formatting, and transports at extreme scale is unknown.
- Specialized logging domains (e.g., security audit logs) — Library lacks built-in features for immutable logging, log signing, or compliance-specific output formats.
- Minimal bundle size is critical — No tree-shaking analysis or bundle-size metrics provided; actual footprint in browser contexts unclear.
- Existing heavy logging infrastructure dependency — Transport layer is extensible but requires custom integration code; no pre-built connectors to enterprise logging platforms documented.
License & commercial use
MIT License. Permissive OSI-approved license allowing unrestricted commercial use, modification, and distribution with attribution and no warranty.
MIT license explicitly permits commercial use without restriction. Attribution required. No license revenue or support service terms stated in provided data; assume community-supported unless sponsor/enterprise arrangements are separately negotiated.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Strong |
| Assessment confidence | High |
Secret masking via maskValuesOfKeys mitigates accidental credential leakage; validate that masked keys cover all sensitive fields in your application. JSON output is unencrypted; secure log transmission and storage separately. No cryptographic audit, penetration test results, or known vulnerability history provided in data.
Alternatives to consider
Pino
Focused JSON logging for Node.js with stronger performance benchmarks and pre-built transports; tslog offers multi-runtime flexibility and pretty-print convenience instead.
Winston
Mature, widely-adopted Node.js logger with extensive ecosystem and commercial support options; tslog is lighter-weight and TypeScript-first with browser/Deno support.
Bunyan
JSON-first structured logging with strong operational conventions; tslog adds pretty formatting and universal runtime support at the cost of smaller ecosystem.
Build on tslog with DEV.co software developers
tslog provides a single, flexible logging abstraction across all your runtimes. Start with npm install tslog and review the GitHub repository for advanced configuration and transport integration.
Talk to DEV.coRelated on DEV.co
Explore the category and the services that help you build with it.
tslog FAQ
Does tslog support tree-shaking in browsers?
Can I use tslog in both Node.js and browser in the same codebase?
How do I integrate tslog with external logging services (Datadog, Sentry)?
What is the performance impact of secret masking?
Software developers & web developers for hire
Need help beyond evaluating tslog? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source observability integrations — and maintain them long-term.
Ready to streamline logging in your TypeScript application?
tslog provides a single, flexible logging abstraction across all your runtimes. Start with npm install tslog and review the GitHub repository for advanced configuration and transport integration.