LogTape 2.1.0: Throttling, logfmt, and smarter redaction · dahlia/logtape · Discussion #165 · GitHub
//voltron/discussions_fragments/discussion_layout" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
//voltron/discussions_fragments/discussion_layout;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
dahlia
logtape
Public
Uh oh!
There was an error while loading. Please reload this page.
Notifications<br>You must be signed in to change notification settings
Fork<br>41
Star<br>1.8k
LogTape 2.1.0: Throttling, logfmt, and smarter redaction
#165
dahlia
announced in<br>Announcements
LogTape 2.1.0: Throttling, logfmt, and smarter redaction
#165
dahlia
May 17, 2026<br>·<br>0 comments
Return to top
Discussion options
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Quote reply
dahlia
May 17, 2026
Maintainer
LogTape is a logging library for JavaScript and TypeScript that works across Deno, Node.js, Bun, and browsers. It's built around structured logging, has zero dependencies, and is designed to work as well in library code as in application code.
Version 2.1.0 adds a throttling filter for high-volume production environments, a logfmt formatter that splits the difference between plain text and JSON, timezone control for timestamps, and substantial improvements to the redaction package. Here's what changed.
Throttling filter
Production services sometimes hit conditions where the same log message fires thousands of times a second: a database that's down, a misconfigured retry loop, a validation error on every request. The log volume becomes noise, and the underlying cause gets buried.
The new getThrottlingFilter() addresses this. It tracks records by category, level, and raw message template, so records with different interpolated values are still counted as the same pattern:
import { configure, getConsoleSink, getThrottlingFilter } from "@logtape/logtape";
await configure({<br>filters: {<br>throttle: getThrottlingFilter({ limit: 5, windowMs: 10_000 }),<br>},<br>sinks: { console: getConsoleSink() },<br>loggers: [<br>{ category: ["my-app"], sinks: ["console"], filters: ["throttle"] }<br>],<br>});
The default mode is fixed-window: the window opens when the first matching record arrives, allows up to limit records during windowMs, and suppresses the rest until it closes. Switch to "sliding" if you want a rolling count instead.
You can define what counts as “the same record” with a custom key function. For multi-tenant applications, for example, you might want to throttle per tenant ID rather than per message template:
String(record.properties.tenantId),<br>});">const throttle = getThrottlingFilter({<br>limit: 20,<br>windowMs: 60_000,<br>key: (record) => String(record.properties.tenantId),<br>});
When suppressed records are released, the filter can emit a summary so you know how many were dropped:
getThrottlingFilter({<br>limit: 5,<br>windowMs: 10_000,<br>summary: {<br>logger: getLogger(["my-app", "log-throttle"]),<br>level: "warning",<br>message: "Last log message was suppressed {suppressed} times.",<br>},<br>});
Summary records carry structured properties including suppressed, allowed, startTime, endTime, and the first and last records from the suppressed window.
See the throttling filter documentation for the full API.
Logfmt formatter
Plain text is readable but loses structure. JSON preserves structure but is noisy to scan in a terminal. Logfmt splits the difference: level=info msg="User login" user_id=123 duration=45ms is both grep-friendly and parseable by log management tools.
LogTape now ships logfmtFormatter as a built-in:
import { configure, getConsoleSink, logfmtFormatter } from "@logtape/logtape";
await configure({<br>sinks: {<br>console: getConsoleSink({ formatter: logfmtFormatter }),<br>},<br>// ...<br>});
When you need to customize behavior, use getLogfmtFormatter() with LogfmtFormatterOptions. There's also a #logfmt shorthand for @logtape/config configurations.
Timezone control for timestamps
Until now, text-based formatters rendered timestamps in UTC regardless of where the application was running. The new timeZone option lets you specify an IANA timezone name or a fixed...