Skip to main content
@squasher-ai/winston is a Winston transport. It sends your Winston logs to Squasher, and log lines at error level become issues. This page is tested with version 0.4.2 and Winston 3.19 on Node.js 26.

Install the transport

Add your ingest key and project ID to the environment of your service:
.env
To get both values, see Create an ingest key.

Add the transport to your logger

src/logger.ts
level sets the lowest level that goes to Squasher. The service field in defaultMeta sets the service name in Squasher. Other metadata goes into the event’s extra data.

Log errors

Pass the error as the first argument:
src/checkout.ts
With format.errors({ stack: true }), the event gets the error message and a stack field in its extra data. Winston does not serialize an Error object inside metadata, so logger.error("checkout failed", { error }) sends {} for error.

Send a test error

Run this once with the same environment variables:
scripts/squasher-test.ts
The transport sends events in batches, every 5 seconds or when 25 events are queued. When the process exits, it sends the rest before the process ends, waiting up to 5 seconds. Then select Issues in the sidebar of your project. If the error does not appear, see Troubleshooting.

Options

Winston warn becomes warning. verbose and silly become debug. Other levels, such as http, become info.

Limits

  • The transport has no environment or release option, so its events have no environment. Automatic AI triage runs only on production issues. To triage an issue from this transport, select Run triage in the Squasher triage card on the issue page.
  • The stack trace is an extra field, so the issue page does not show it as a stack trace.
  • The transport does not retry a failed send.
  • After an HTTP 401 response, the transport stops sending until the process restarts.
  • The batch size and the interval are fixed. You cannot change them.

Give the setup to a coding agent

Copy this prompt into your coding agent to install the transport the same way:

Next steps

Node.js SDK

Capture errors with an environment, a release, and stack traces.

Pino transport

Send Pino logs, with an environment option.

Design queryable logs

Choose log fields that are easy to search.

Read AI triage

Learn what the triage summary tells you.