LogTape changelog β
Version 1.0.0 β
To be released.
Added
getLogLevels()
function to retrieve all available log levels.Added
LogMethod
type for better type inference of logger methods.Added
nonBlocking
option togetConsoleSink()
,getStreamSink()
,getFileSink()
, andgetRotatingFileSink()
for high-performance logging scenarios. When enabled, log records are buffered and flushed in the background, preventing blocking of the main thread.- Console and stream sinks accept
nonBlocking?: boolean | { bufferSize?: number; flushInterval?: number }
option. - File sinks accept
nonBlocking?: boolean
option. - Default buffer size is 100 records for console/stream sinks and background flushing for file sinks.
- Default flush interval is 100ms for console/stream sinks.
- Console sink returns
Sink & Disposable
in non-blocking mode. - Stream and file sinks return
Sink & AsyncDisposable
in non-blocking mode. - Buffer-full flushes are now asynchronous (non-blocking) instead of synchronous to maintain performance during high-volume logging.
- Console and stream sinks include automatic buffer overflow protection that prevents unbounded memory growth by dropping oldest records when buffer exceeds 2x the configured size.
- Errors during background flushing are silently ignored to prevent application disruption.
- Console and stream sinks accept
Added
getStreamFileSink()
function in @logtape/file package for high-performance file logging using Node.js PassThrough streams.- Added
StreamFileSinkOptions
interface for configuring stream-based file sink behavior. - Uses PassThrough streams piped to WriteStreams for optimal I/O performance with automatic backpressure management and non-blocking writes.
- Optimized for high-volume logging scenarios with superior throughput compared to standard file sinks.
- Simple configuration with
highWaterMark
(default: 16384 bytes) and optional customformatter
options. - Automatic stream cleanup and proper resource disposal via
Disposable
interface. - Ideal for production applications requiring high-performance file logging without complex buffering configuration.
- Added
Added
withBuffer()
function to create buffered sinks that collect log records in memory and flush them to the underlying sink when the buffer is full or after a specified time interval.- Added
BufferSinkOptions
interface for configuring buffer behavior. withBuffer()
acceptsbufferSize
(default: 10 records) andflushInterval
(default: 5000ms) options.- Buffered sinks automatically flush when buffer is full, time interval elapses, or the sink is disposed.
- Returns a sink with
AsyncDisposable
support for proper cleanup.
- Added
Added
fromAsyncSink()
function to convert async sinks to regular sinks with proper async handling.- Added
AsyncSink
type:(record: LogRecord) => Promise<void>
. fromAsyncSink()
chains async operations to ensure order preservation.- Errors in async sinks are caught to prevent breaking the promise chain.
- Returns a sink with
AsyncDisposable
support that waits for all pending operations on disposal.
- Added
Added @logtape/cloudwatch-logs package for AWS CloudWatch Logs integration. [#48, #49]
- Added
getCloudWatchLogsSink()
function to send logs to AWS CloudWatch Logs. - Added
CloudWatchLogsSinkOptions
interface for configuration. - Supports intelligent batching up to 10,000 events or 1MiB per batch.
- Includes exponential backoff retry strategy for error handling.
- Works with existing CloudWatch Logs clients or creates new ones automatically.
- Supports custom AWS credentials and regions.
- Added
formatter
option to support custom text formatters, includingjsonLinesFormatter()
for enhanced CloudWatch Logs Insights querying capabilities with dot notation support.
- Added
Added @logtape/windows-eventlog package for Windows Event Log integration. [#47, #50]
- Added
getWindowsEventLogSink()
function to send logs to Windows Event Log. - Added
WindowsEventLogSinkOptions
interface for configuration. - Cross-runtime support: Works with Deno, Node.js, and Bun on Windows.
- Uses runtime-optimized FFI implementations: Deno FFI, koffi for Node.js, and Bun FFI for maximum performance.
- Supports all LogTape log levels with proper Event Log type mapping (Error, Warning, Information).
- Includes structured logging support with formatted context information.
- Added
validateWindowsPlatform()
function for platform validation. - Added
WindowsPlatformError
andWindowsEventLogError
for proper error handling. - Platform-restricted installation (Windows only) for safety.
- Includes PowerShell-based test verification for actual Event Log integration.
- Added
Added @logtape/pretty package for beautiful console formatting designed for local development. [#46, #51]
- Added
getPrettyFormatter()
function to create visually appealing log formatters with colorful icons, smart category truncation, and perfect column alignment. - Added
prettyFormatter
constant for quick setup with sensible defaults. - Added
PrettyFormatterOptions
interface for extensive customization. - Features Signale-inspired design with emojis for each log level: π trace, π debug, β¨ info, β οΈ warning, β error, π fatal.
- Includes smart category truncation that preserves important context while maintaining layout (e.g.,
appΒ·serverβ¦middleware
). - Supports true color terminals with rich color schemes and dimmed text for enhanced readability.
- Provides optional timestamp display, custom icons, color control, and flexible layout options.
- Supports multiple text styles combination (e.g.,
["bold", "underline"]
) for level, category, message, and timestamp formatting. - Includes word wrapping feature with proper indentation alignment to maintain visual consistency for long messages.
- Optimized for development environments with focus on visual clarity and developer experience.
- Added
Added @logtape/adaptor-pino package for integrating LogTape with Pino logging infrastructure. [#52]
- Added
getPinoSink()
function to forward LogTape log records to Pino loggers. - Added
PinoSinkOptions
interface for configuring the adapter behavior. - Added
CategoryOptions
interface for customizing category formatting in Pino log messages. - Added
install()
function for convenient auto-configuration with custom Pino logger and configuration options. - Supports configurable category display with position (
start
/end
), decorators ([]
,()
,<>
,{}
,:
,-
,|
,/
, or none), and custom separators for multi-part categories. - Maps LogTape log levels to equivalent Pino levels.
- Preserves LogTape's structured logging properties as Pino fields.
- Enables seamless adoption of LogTape-enabled libraries in applications using Pino without requiring logging infrastructure changes.
- Added
Added @logtape/adaptor-winston package for integrating LogTape with winston logging infrastructure. [#52]
- Added
getWinstonSink()
function to forward LogTape log records to winston loggers. - Added
WinstonSinkOptions
interface for configuring the adapter behavior. - Added
CategoryOptions
interface for customizing category formatting in winston log messages. - Added
install()
function for convenient auto-configuration with optional custom winston logger and configuration options. - Added
install.ts
module for automatic setup via simple import. - Supports configurable category display with position (
start
/end
), decorators ([]
,()
,<>
,{}
,:
,-
,|
,/
, or none), and custom separators for multi-part categories. - Maps LogTape log levels to equivalent winston levels with customizable level mapping.
- Supports custom value formatters for interpolated values in log messages.
- Preserves LogTape's structured logging properties as winston fields.
- Enables seamless adoption of LogTape-enabled libraries in applications using winston without requiring logging infrastructure changes.
- Added
Fixed browser support for @logtape/otel package by removing direct
node:process
dependency. [#53]- Replaced
node:process
import with cross-runtime environment variable access that works in Deno, Node.js, and browsers. - Changed tsdown platform setting from
"node"
to"neutral"
to enable browser compatibility. - The
getOpenTelemetrySink()
function now works in all JavaScript runtimes without throwing module resolution errors.
- Replaced
Removed the deprecated
LoggerConfig.level
property. UseLoggerConfig.lowestLevel
instead for setting the minimum log level, or useLoggerConfig.filters
for more advanced filtering.
Version 0.12.1 β
Released on June 19, 2025.
Fixed module resolution issues in CommonJS environments and bundlers like Vite by properly configuring conditional exports for types.
- Updated all package.json exports to use conditional
types
exports with separate.d.ts
files for ESM imports and.d.cts
files for CommonJS requires. - This resolves runtime errors in frameworks like SvelteKit that require proper CommonJS modules for modules imported in CommonJS contexts.
- Updated all package.json exports to use conditional
Version 0.12.0 β
Released on June 15, 2025.
Added the
"trace"
severity level, which is lower than"debug"
. [#24]- Added
"trace"
to theLogLevel
union type. - Added
Logger.trace()
method.
- Added
Added
Logger.warning()
method which is an alias forLogger.warn()
. [#44]Added
bufferSize
andflushInterval
options toFileSinkOptions
for configurable buffering in file sinks.getFileSink()
andgetRotatingFileSink()
functions now accept abufferSize
option to control write buffering behavior.getFileSink()
andgetRotatingFileSink()
functions now accept aflushInterval
option to control the time-based flushing of the buffer to disk.- When
bufferSize
is 0 or negative, writes are immediate without buffering. - When
bufferSize
is positive, log entries are buffered until the buffer size is exceeded, then flushed to disk. - Default buffer size is 8192 characters for improved performance.
- Buffer content is automatically flushed when the sink is disposed.
- When
flushInterval
is 0 or negative, the time-based flushing is disabled. - Default
flushInterval
is 5000 milliseconds (5 seconds) for periodic flushing.
Added @logtape/syslog package for sending log messages to syslog servers using RFC 5424 format.
- Added
getSyslogSink()
function to create syslog sinks with support for both UDP and TCP protocols. - Supports all standard RFC 5424 facilities (
kern
,user
,mail
,daemon
,local0
β7
, etc.) and automatic priority calculation. - Includes structured data support for log record properties with proper RFC 5424 escaping of special characters.
- Cross-runtime compatibility with Deno, Node.js, and Bun.
- Configurable connection timeouts, custom hostnames, and application names.
- Added
Now @logtape/otel, @logtape/sentry, and @logtape/syslog packages are released along with @logtape/logtape package. This means they share the same version number and changelog. This is to ensure that the packages are always compatible with each other and to simplify the release process.
Improved build and test infrastructure by migrating from dnt to tsdown for npm package bundling. [#43]
Version 0.11.0 β
Released on June 2, 2025.
Loggers now allow to interpolate all properties at once through the special placeholder
{*}
. This is useful for logging objects with many properties without having to specify each property name in the message template.Logger.debug()
,Logger.info()
,Logger.warn()
,Logger.error()
, andLogger.fatal()
methods now accept a message template with the{*}
placeholder. Unless there is a property with the name*
, the{*}
placeholder will be replaced with a stringified version of theLogRecord.properties
object.- As a shorthand, overloads of
Logger.debug()
,Logger.info()
,Logger.warn()
,Logger.error()
, andLogger.fatal()
methods that accept an object as the first argument now treat the object as a message template with the{*}
placeholder. This is equivalent to calling the method with a message template of{*}
and the object as the second argument.
Added the built-in JSON Lines formatter.
- Added
jsonLinesFormatter()
function. - Added
getJsonLinesFormatter()
function. - Added
JsonLinesFormatterOptions
interface.
- Added
Version 0.10.0 β
Released on May 19, 2025.
Added
@logtape/redaction
package for redacting sensitive information from log records.- Added
redactByField()
function. - Added
FieldPattern
type. - Added
FieldPatterns
type. - Added
FieldRedactionOptions
interface. - Added
DEFAULT_REDACT_FIELDS
constant. - Added
redactByPattern()
function. - Added
RedactionPattern
interface. - Added
RedactionPatterns
type. - Added
CREDIT_CARD_NUMBER_PATTERN
constant. - Added
EMAIL_ADDRESS_PATTERN
constant. - Added
JWT_PATTERN
constant. - Added
KR_RRN_PATTERN
constant. - Added
US_SSN_PATTERN
constant.
- Added
The text formatter now can omit the timestamp from the formatted message. [#35 by Ooker]
- Changed the type of the
TextFormatterOptions.timestamp
option to"date-time-timezone" | "date-time-tz" | "date-time" | "time-timezone" | "time-tz" | "time" | "date" | "rfc3339" | "none" | "disabled" | ((ts: number) => string | null)
(was"date-time-timezone" | "date-time-tz" | "date-time" | "time-timezone" | "time-tz" | "time" | "date" | "rfc3339" | ((ts: number) => string)
). - Changed the type of the
FormattedValues.timestamp
property tostring | null
(wasstring
).
- Changed the type of the
Added
FileSinkOptions.lazy
option. [#38, #39 by Rickey Ward]The
configure()
andconfigureSync()
functions now check for duplicate logger configurations with the same category and throw aConfigError
when detected. This prevents unintended overriding of logger configurations when configuring multiple loggers with the same category. [#41]
Version 0.9.2 β
Released on May 15, 2025.
- Fixed a bug where importing
@logtape/logtape
threw aReferenceError
on Node.js or Bun when LogTape was installed from JSR (instead of npm). [#42]
Version 0.9.1 β
Released on April 24, 2025.
- Fixed a CORS error when using LogTape in web browser environments like Fresh islands components due to importing Node.js
node:util
module. [#40]
Version 0.9.0 β
Released on March 1, 2025.
Moved file sinks and rotating file sinks to separate packages. [#19, #27, #28]
- Moved
getFileSink()
function to@logtape/file
package. - Moved
FileSinkOptions
interface to@logtape/file
package. - Moved
getRotatingFileSink()
function to@logtape/file
package. - Moved
RotatingFileSinkOptions
interface to@logtape/file
package.
- Moved
Added synchronous versions of configuration functions. [#12, #29 by Murph Murphy]
- Added
configureSync()
function. - Added
disposeSync()
function. - Added
resetSync()
function.
- Added
Added
ConsoleSinkOptions.levelMap
option.
Version 0.8.2 β
Released on February 11, 2025.
- Fixed a bug of text formatters where they truncated string and array values in the formatted message. [#30]
Version 0.8.1 β
Released on February 1, 2025.
- Fixed a bug where when a child logger is configured with a lower
lowestLevel
than its parent logger, a log record with a severity level lower than the parent logger'slowestLevel
and higher than the child logger'slowestLevel
would not be filtered out by the parent logger.
Version 0.8.0 β
Released on November 20, 2024.
Renewed the API to configure the lowest severity level of loggers. [#26]
- Added
LoggerConfig.lowestLevel
property. - Deprecated
LoggerConfig.level
property in favor ofLoggerConfig.lowestLevel
.
- Added
Added
compareLogLevel()
function.
Version 0.7.2 β
Released on February 11, 2025.
- Fixed a bug of text formatters where they truncated string and array values in the formatted message. [#30]
Version 0.7.1 β
Released on October 30, 2024.
- The
withContext()
function no more throws an error even if nocontextLocalStorage
is configured. Instead, it will log a warning message to the["logtape", "meta"]
logger.
Version 0.7.0 β
Released on October 29, 2024.
Introduced implicit contexts.
- Added
withContext()
function. - Added
Config.contextLocalStorage
option. - Added
ContextLocalStorage
interface.
- Added
Version 0.6.5 β
Released on February 11, 2025.
- Fixed a bug of text formatters where they truncated string and array values in the formatted message. [#30]
Version 0.6.4 β
Released on October 28, 2024.
- Fixed a build warning due to importing
node:fs
andnode:util
modules on Next.js' client rendering. [#19] - Made it to work on Deno 2.0.0 or higher.
Version 0.6.3 β
Released on October 3, 2024.
- Fixed a build error due to importing
node:fs
andnode:util
modules on Next.js' client rendering.
Version 0.6.2 β
Released on September 24, 2024.
Version 0.6.1 β
Released on September 24, 2024.
Version 0.6.0 β
Released on September 24, 2024.
Loggers now can override sinks of their ascendants. Still, they inherit the sinks of their ascendants by default. [#15]
- Added
LoggerConfig.parentSinks
property.
- Added
Placeholders in message templates now forgive leading and trailing spaces. However, if a property with exactly the same name exists, it will be prioritized over space-trimmed properties. [#16]
Added
LogRecord.rawMessage
property. [#17]Built-in text formatters now can be customized with a
TextFormatterOptions
object. [#13]- Added
TextFormatterOptions
interface. - Added
FormattedValues
interface. - Added
getTextFormatter()
function. - Added
AnsiColor
type. - Added
AnsiStyle
type. - Added
AnsiColorFormatterOptions
interface. - Added
getAnsiColorFormatter()
function.
- Added
Version 0.5.4 β
Released on September 24, 2024.
Version 0.5.3 β
Released on September 24, 2024.
Version 0.5.2 β
Released on September 23, 2024.
Version 0.5.1 β
Released on September 10, 2024.
Fixed a bug of
defaultTextFormatter()
function where it rendered embedded values in the message as JSON instead ofutil.inspect()
on Node.js and Bun.Fixed a bug of
ansiColorFormatter()
function where it failed to colorize embedded values in the message on Node.js and Bun.
Version 0.5.0 β
Released on August 29, 2024.
LogTape now provides contexts for loggers. [#7, #8]
- Added
Logger.with()
method.
- Added
The console sink now can take a
TextFormatter
besides aConsoleFormatter
for formatting log records.- The type of
ConsoleSinkOptions.formatter
becameConsoleFormatter | TextFormatter | undefined
(wasConsoleFormatter | undefined
).
- The type of
Added
ansiColorFormatter()
function.configure()
function'sfilters
option became optional.- The type of
Config.filters
becameRecord<string, FilterLike> | undefined
(wasRecord<string, FilterLike>
).
- The type of
Version 0.4.3 β
Released on August 22, 2024.
- Fixed a bug where
getRotatingFileSink()
function had failed to create a new log file when there's no log file to rotate yet. [#9]
Version 0.4.2 β
Released on July 15, 2024.
LogTape now works well on edge functions. [#5]
- The npm version of LogTape no more depends on
node:stream/web
module. - LogTape now works well with JavaScript runtimes that do not support
node:fs
module. - LogTape now works well with JavaScript runtimes that do not support
WeakRef
class. - Got rid of
eval()
from LogTape.
- The npm version of LogTape no more depends on
Version 0.4.1 β
Released on July 2, 2024.
- Fixed a bug where LogTape failed to load under Node.js when incorporated in a project from JSR. [#3, #4 by Kitson Kelly]
Version 0.4.0 β
Released on May 7, 2024.
Version 0.3.1 β
Released on May 7, 2024.
- Fixed a bug where two or more versions of LogTape were imported in the same runtime, the
Logger
instances would not be shared between them. This was caused by theLogger
instances being stored in a module-level variable.
Version 0.3.0 β
Released on April 22, 2024.
- Added
parseLogLevel()
function. - Added
isLogLevel()
function. - Added
getConfig()
function. - Added
withFilter()
function.
Version 0.2.3 β
Released on May 7, 2024.
- Fixed a bug where two or more versions of LogTape were imported in the same runtime, the
Logger
instances would not be shared between them. This was caused by theLogger
instances being stored in a module-level variable.
Version 0.2.2 β
Released on April 21, 2024.
- Fixed a bug where the configured sinks and filters were reset after some inactivity. This was caused by garbage collection of the
Logger
instances. TheLogger
instances are now kept alive by an internal set of strong references until explicitlyreset()
is called.
Version 0.2.1 β
Released on April 20, 2024.
- Removed
FileSinkDriver
interface. - Added
RotatingFileSinkOptions
interface.
Version 0.2.0 β
Released on April 20, 2024.
Sinks now can be asynchronously disposed of. This is useful for sinks that need to flush their buffers before being closed.
- Added
dispose()
function. - The return type of
configure()
function becamePromise<void>
(wasvoid
). - The return type of
reset()
function becamePromise<void>
(wasvoid
). - Configured sinks that implement
AsyncDisposable
are now disposed of asynchronously when the configuration is reset or the program exits.
- Added
The return type of
getStreamSink()
function becameSink & AsyncDisposable
(wasSink & Disposable
).Added
getRotatingFileSink()
function.
Version 0.1.2 β
Released on May 7, 2024.
- Fixed a bug where two or more versions of LogTape were imported in the same runtime, the
Logger
instances would not be shared between them. This was caused by theLogger
instances being stored in a module-level variable.
Version 0.1.1 β
Released on April 21, 2024.
- Fixed a bug where the configured sinks and filters were reset after some inactivity. This was caused by garbage collection of the
Logger
instances. TheLogger
instances are now kept alive by an internal set of strong references until explicitlyreset()
is called.
Version 0.1.0 β
Initial release. Released on April 19, 2024.