log
한국어 (Korean): LogTape 0.12.0 릴리스 노트
日本語 (Japanese): LogTape 0.12.0 リリースノート
中文(台灣) (Chinese (Taiwan)): LogTape 0.12.0 發布說明
中文(中国) (Chinese (China)): LogTape 0.12.0 发布说明
LogTape is a zero-dependency logging library for JavaScript and TypeScript that provides a simple yet flexible logging system. It supports multiple JavaScript runtimes (Deno, Node.js, Bun, browsers, and edge functions), features hierarchical categories, structured logging, and offers seamless integration for both applications and libraries.
What's New in 0.12.0
Trace Log Level
LogTape now includes a trace severity level, which sits below debug in the verbosity hierarchy. This addition provides finer-grained control over logging output, particularly useful for detailed execution flow tracking during development and debugging.
Added "trace" to the LogLevel union type
Added Logger.trace() method for logging trace-level messages
The complete severity hierarchy is now: trace < debug < info < warning < error < fatal
Enhanced File Sink Performance
File sinks now support configurable buffering, significantly improving write performance for high-volume logging scenarios.
Added bufferSize option (default: 8192 characters) to control write buffering behavior
Added flushInterval option (default: 5000ms) for automatic time-based buffer flushing
Set bufferSize to 0 for immediate writes without buffering
Set flushInterval to 0 to disable time-based flushing
Buffer contents are automatically flushed when the sink is disposed
These options are available for both getFileSink() and getRotatingFileSink() functions.
Syslog Support
The new @logtape/syslog package enables sending log messages to syslog servers using the RFC 5424 format.
Support for both UDP and TCP protocols
All standard RFC 5424 facilities (kern, user, mail, daemon, local0–7, etc.)
Automatic priority calculation based on log levels
Structured data support for log record properties
Cross-runtime compatibility with Deno, Node.js, and Bun
Configurable connection timeouts, custom hostnames, and application names
Logger Method Alias
Added Logger.warning() as an alias for Logger.warn() to ensure consistency with the LogLevel type definition. This change addresses the naming mismatch where the LogLevel union type uses "warning" while the logger method was named warn(), making metaprogramming and dynamic method invocation more straightforward.
Unified Package Releases
Starting with version 0.12.0, all LogTape packages including @logtape/otel, @logtape/sentry, and @logtape/syslog share the same version number and are released together. This ensures compatibility between packages and simplifies version management for users.
Improved Build Infrastructure
LogTape has migrated from dnt to tsdown for npm package bundling. tsdown is a library-focused bundler built on top of Rolldown, a Rust-based bundler that powers the next generation of Vite. Unlike general-purpose bundlers, tsdown is specifically optimized for building TypeScript and JavaScript libraries with minimal configuration. This change brings several benefits:
Elimination of bundler warnings in Webpack, Vite, and other build tools
Improved compatibility with modern JavaScript toolchains
Better tree-shaking support
Cleaner package output
Faster build times through Rust-based performance optimizations
Migration Guide
Updating to Trace Level
If you have code that relies on debug being the lowest severity level, you may need to update your log level configurations:
// Before{ lowestLevel: "debug" } // This was the most verbose setting// After{ lowestLevel: "trace" } // Now includes trace messages
Leveraging Buffer Configuration
To optimize file sink performance in high-throughput scenarios:
getFileSink("app.log", { bufferSize: 16384, // Larger buffer for better performance flushInterval: 10_000 // Flush every 10 seconds})
Installation
LogTape 0.12.0 is available on JSR and npm:
deno add jsr:@logtape/logtape # Denonpm add @logtape/logtape # npmpnpm add @logtape/logtape # pnpmyarn add @logtape/logtape # yarnbun add @logtape/logtape # Bun
For the syslog sink:
deno add jsr:@logtape/syslog # Denonpm add @logtape/syslog # npmpnpm add @logtape/syslog # pnpmyarn add @logtape/syslog # yarnbun add @logtape/syslog # Bun
Acknowledgments
We thank all contributors who helped make this release possible, including those who reported issues, submitted pull requests, and provided feedback.
For the complete list of changes, please refer to the changelog.
Takahe has limited support for this type: See Original Article한국어 (Korean): LogTape 1.0.0 출시 발표
日本語 (Japanese): LogTape 1.0.0 発表のお知らせ
What is LogTape?
LogTape is a logging library designed specifically for the modern JavaScript ecosystem. It stands out with its zero-dependency architecture, universal runtime support across Node.js, Deno, Bun, browsers, and edge functions, and a library-first design philosophy that allows library authors to add logging without imposing any burden on their users. When LogTape isn't configured, logging calls have virtually no performance impact, making it the only truly unobtrusive logging solution available.
For a comprehensive overview of LogTape's capabilities and philosophy, see our introduction guide.
Milestone achievement
We're excited to announce LogTape 1.0.0, marking a significant milestone in the library's development. This release represents our commitment to API stability and long-term support. The 1.0.0 designation signals that LogTape's core APIs are now stable and ready for production use, with any future breaking changes following semantic versioning principles.
This milestone builds upon months of refinement, community feedback, and real-world usage, establishing LogTape as a mature and reliable logging solution for JavaScript applications and libraries.
Major new features
High-performance logging infrastructure
LogTape 1.0.0 introduces several performance-oriented features designed for high-throughput production environments. The new non-blocking sink option allows console, stream, and file sinks to buffer log records and flush them asynchronously, preventing logging operations from blocking your application's main thread.
import { configure, getConsoleSink } from "@logtape/logtape";await configure({ sinks: { console: getConsoleSink({ nonBlocking: { bufferSize: 1000, flushInterval: 50 } }) }, // ...});
The new fromAsyncSink() function provides a clean way to integrate asynchronous logging operations while maintaining LogTape's synchronous sink interface. This enables scenarios like sending logs to remote servers or databases without blocking your application.
import { fromAsyncSink } from "@logtape/logtape";const webhookSink = fromAsyncSink(async (record) => { await fetch("https://logs.example.com", { method: "POST", body: JSON.stringify(record) });});
For file operations specifically, the new getStreamFileSink() function in the @logtape/file package leverages Node.js PassThrough streams to deliver optimal I/O performance with automatic backpressure management.
New sink integrations
This release significantly expands LogTape's integration capabilities with two major new sink packages. The @logtape/cloudwatch-logs package enables direct integration with AWS CloudWatch Logs, featuring intelligent batching, exponential backoff retry strategies, and support for structured logging through JSON Lines formatting.
import { getCloudWatchLogsSink } from "@logtape/cloudwatch-logs";const sink = getCloudWatchLogsSink({ logGroupName: "/aws/lambda/my-function", logStreamName: "my-stream", region: "us-east-1"});
The @logtape/windows-eventlog package brings native Windows Event Log support with cross-runtime compatibility across Deno, Node.js, and Bun. This integration uses runtime-optimized FFI implementations for maximum performance while maintaining proper error handling and resource cleanup.
Beautiful development experience
The new @logtape/pretty package transforms console logging into a visually appealing experience designed specifically for local development. Inspired by Signale, it features colorful emojis for each log level, smart category truncation that preserves important context, and perfect column alignment that makes logs easy to scan.
import { configure, getConsoleSink } from "@logtape/logtape";import { prettyFormatter } from "@logtape/pretty";await configure({ sinks: { console: getConsoleSink({ formatter: prettyFormatter }) }, // ...});
As shown above, the pretty formatter supports true color terminals with rich color schemes, configurable icons, and intelligent word wrapping that maintains visual consistency even for long messages.
Ecosystem integration
Perhaps most significantly, LogTape 1.0.0 introduces adapter packages that bridge the gap between LogTape's library-friendly design and existing logging infrastructure. The @logtape/adaptor-winston and @logtape/adaptor-pino packages allow applications using these established logging libraries to seamlessly integrate LogTape-enabled libraries without changing their existing setup.
// Quick setup with winstonimport "@logtape/adaptor-winston/install";
// Or with custom configurationimport { install } from "@logtape/adaptor-winston";import winston from "winston";const logger = winston.createLogger({/* your config */});install(logger);
These adapters preserve LogTape's structured logging capabilities while routing everything through your preferred logging system, making adoption of LogTape-enabled libraries frictionless for existing applications.
Developer experience enhancements
This release includes several quality-of-life improvements for developers working with LogTape. The new getLogLevels() function provides programmatic access to all available log levels, while the LogMethod type offers better type inference for logging methods.
Browser compatibility has been improved, particularly for the @logtape/otel package, which previously had issues in browser environments due to Node.js-specific imports. The package now works seamlessly across all JavaScript runtimes without throwing module resolution errors.
Breaking changes and migration guide
LogTape 1.0.0 includes one notable breaking change: the removal of the deprecated LoggerConfig.level property. This property was deprecated in version 0.8.0 in favor of the more descriptive LoggerConfig.lowestLevel property.
If your configuration still uses the old property, simply rename it:
// Before (deprecated){ category: ["app"], level: "info", sinks: ["console"] }
// After{ category: ["app"], lowestLevel: "info", sinks: ["console"] }
For more complex filtering requirements, consider using the LoggerConfig.filters option instead, which provides more flexibility and supports inheritance from parent loggers.
Complete package ecosystem
LogTape 1.0.0 represents the culmination of a comprehensive package ecosystem, now consisting of 11 specialized packages that address different aspects of logging infrastructure. This modular approach allows you to install only the packages you need, keeping your dependency footprint minimal while accessing powerful logging capabilities when required.
PackageJSRnpmDescription@logtape/logtapeJSRnpmCore logging functionality@logtape/adaptor-pinoJSRnpmPino adapter@logtape/adaptor-winstonJSRnpmwinston adapter@logtape/cloudwatch-logsJSRnpmAWS CloudWatch Logs sink@logtape/fileJSRnpmFile sinks@logtape/otelJSRnpmOpenTelemetry sink@logtape/prettyJSRnpmBeautiful text formatter@logtape/redactionJSRnpmData redaction@logtape/sentryJSRnpmSentry sink@logtape/syslogJSRnpmSyslog sink@logtape/windows-eventlogJSRnpmWindows Event Log sinkGetting started
Whether you're new to LogTape or upgrading from a previous version, getting started with 1.0.0 is straightforward. For new projects, begin with a simple configuration and gradually add the packages and features you need:
import { configure, getConsoleSink } from "@logtape/logtape";await configure({ sinks: { console: getConsoleSink() }, loggers: [ { category: "my-app", lowestLevel: "info", sinks: ["console"] } ]});
Existing applications using winston or Pino can immediately benefit from LogTape-enabled libraries by installing the appropriate adapter. For comprehensive migration guidance and detailed feature documentation, visit our documentation site.
The 1.0.0 release represents not just a version number, but a commitment to the stability and maturity that production applications require. We're excited to see what you'll build with LogTape.
Takahe has limited support for this type: See Original Article