npm / @mastra/loggers
@mastra/loggers
What changed in @mastra/loggers 0.10 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
7 breaking2 security10 new APIs and options2 performance4 behavior and defaults22 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@mastra/loggers 146 changes
Breaking changes 6
listLogsandlistLogsByRunIdreject invalid pagination values with aRangeError; zero values still default to page 1 and 100 per page.Throws a clear error at construction when a directory is supplied as the log path.
Rejects with a MastraError when the log file cannot be read instead of returning an empty result; malformed lines are still skipped.
Requires batchSize and maxBufferSize to be positive integers; invalid values now cause the constructor to throw.
Removed the component field from pino-pretty log output to reduce noise in CLI logs.
The minimum required Node.js version is now 22.13.0.
Security 2
Publishes clean versions and moves the latest dist-tag forward, superseding compromised versions that declared the malicious easy-day-js dependency.
PinoLogger exposes Pino’s native redact option to automatically redact sensitive data from logs.
New APIs and options 10
Adds a field that counts records dropped when the in-memory buffer is full.
Adds a positive-integer limit for unsent records kept in memory; it defaults to maxListLength or 10000 when trimming is off.
Adds a method to report how many logs were dropped by the transport.
Caps the log buffer at a default of 10,000 entries; when full, the oldest logs are dropped first.
A new serializers option lets you override or extend the default serializers.
Added the messageKey option to emit log messages under the message field expected by structured-log aggregators.
PinoLogger accepts customLevels to define custom log levels and match an existing Pino logging setup.
PinoLogger accepts mixin to attach shared fields, such as trace IDs, request IDs, or service metadata, to every log entry.
The new prettyPrint option switches output to single-line JSON for log aggregators instead of multiline colored output.
PinoLogger gains a child() method for creating child loggers with bound context.
Performance 2
FileTransport queries now read the log file as a stream, avoiding event-loop blocking and keeping paginated queries limited to the requested page in memory.
CHANGELOG.md is no longer included in distributed npm files, reducing package size.
Behavior and default changes 4
Log batches are serialized once before sending, so serialization failures fail immediately and network retries resend the same payload.
Upstash log queries now retrieve records in bounded pages.
PinoLogger implements the Mastra logger adapter contract and injects trace_id and span_id into native log records during traced operations, preserving user mixin fields unless they conflict with trace fields.
The package is marked as stable.
Fixes and other changes 22
When maxListLength is positive, filtered queries, listLogsByRunId, and reads with returnPaginationResults: false now return at most the newest maxListLength entries instead of reading the entire Redis log list.
Fixed a TypeScript error when using the mixin option with pino 10.4 or newer; the option type is unchanged.
Idle transports no longer keep scripts and command-line tools running after their work is done, so they exit without calling destroy(); buffered logs still keep the process running until sent.
Logs are retained and retried when Redis rejects a push, with errors reported including to the destroy callback; trim failures are reported without resending already-pushed logs.
Adds a missing timestamp to a copy of the log record instead of modifying the caller's object, allowing frozen records to be sent without a TypeError.
Skips list entries that are not valid JSON, so log queries return only real records and snapshot totals exclude corrupt entries.
Reports failed log writes instead of silently treating them as successful and losing logs without notice.
HTTP and Upstash log queries and Upstash error results now report page 1 when called with page 0, consistent with other transports.
HTTP and Upstash log transports preserve supplied epoch-zero timestamps; logs without a time still receive the current time.
Sends only one request to Upstash at a time, preventing many writes during an outage from opening hundreds of requests.
Shutdown now sends every buffered batch.
Sends only one flush request at a time, avoiding a new failing request for every log written during an outage.
Stops retrying invalid batches, drops them, and counts them with getDroppedLogCount(), so newer logs are not stuck behind them.
Destroying the transport now sends every buffered batch before finishing.
Finds matching logs beyond the first 100 records.
Waits for the duration specified by the server's Retry-After header before retrying, up to the request timeout.
FileTransport log queries now skip malformed lines and still return valid logs instead of returning no logs when a file contains a malformed line.
Setting exponentialBackoff: false now uses a constant delay between retries instead of being ignored.
Explicit maxRetries: 0 now makes a single request instead of being ignored.
Explicit retryDelay: 0 now retries immediately instead of being ignored.
The Upstash logger now trims the log list according to maxListLength, preventing unbounded growth and unreadable entries in listLogs().
Errors logged under the error key are now serialized with their type, message, and stack; non-error-like values pass through, and error-like plain objects preserve their own fields.
@mastra/loggers 0.101 changes
Breaking changes 1
Peer dependencies were updated to match the core package version bump, affecting package compatibility requirements.