LogTape 0.11.0 release notes

洪 民憙 (Hong Minhee) @hongminhee@hackers.pub
LogTape is a zero-dependency logging library for JavaScript and TypeScript that works across all runtimes.
We're excited to announce the release of LogTape 0.11.0, which introduces significant enhancements to structured logging capabilities and adds a new JSON Lines formatter for better log processing.
New features and enhancements
Enhanced structured logging
LogTape 0.11.0 brings major improvements to structured logging, making it easier and more flexible to work with structured data in your logs.
Direct object logging
You can now log structured data directly by passing an object as the first argument to any log method:
logger.info({
userId: 123456,
username: "johndoe",
loginTime: new Date(),
});
This creates a log entry with the object properties as structured fields, making your logs more machine-readable and searchable.
Universal property interpolation with {*}
A new special placeholder {*}
allows you to interpolate all properties from your structured data at once:
logger.info("User logged in with properties {*}", {
userId: 123456,
username: "johndoe",
loginTime: new Date(),
});
This is particularly useful when you want to include all available context without explicitly naming each property in your message template.
Streamlined logging methods
All logging methods (debug
, info
, warn
, error
, fatal
) now support the new object-first syntax as a convenient shorthand for structured logging with the {*}
placeholder.
JSON Lines formatter
LogTape now includes built-in support for JSON Lines (also known as JSONL or NDJSON) format, a popular choice for structured logging in modern applications:
import { jsonLinesFormatter } from "@logtape/logtape";
import { getFileSink } from "@logtape/file";
await configure({
sinks: {
jsonl: getFileSink("app.jsonl", {
formatter: jsonLinesFormatter
}),
},
// ... rest of configuration
});
The JSON Lines formatter outputs each log record as a JSON object on a separate line, making it ideal for log aggregation systems and analysis tools.
Customizable JSON Lines options
The new getJsonLinesFormatter()
function provides several customization options:
- Category separator: Control how hierarchical categories are joined
- Message format: Choose between raw templates or rendered messages
- Properties handling: Flatten properties, nest them, or prepend with custom prefixes
Backward compatibility
All existing logging patterns continue to work exactly as before. The new features are additive and don't break any existing code.
Why this matters
These enhancements make LogTape even more powerful for modern application logging:
- Better observability: Structured data makes logs more searchable and analyzable
- Improved developer experience: Less boilerplate when logging complex objects
- Industry standard formats: JSON Lines support for better integration with log management systems
- Flexible formatting: Customize output to match your infrastructure needs
Installation
LogTape 0.11.0 is available on both JSR and npm:
deno add jsr:@logtape/logtape@0.11.0
npm add @logtape/logtape@0.11.0
pnpm add @logtape/logtape@0.11.0
yarn add @logtape/logtape@0.11.0
bun add @logtape/logtape@0.11.0
Learn more
We hope these new features enhance your logging experience. As always, LogTape remains zero-dependency and works across all JavaScript runtimes.
Happy logging!