# @probot/pino

> formats pino logs and sends errors to Sentry

Latest version **5.0.1** (published 2025-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @probot/pino
pnpm add @probot/pino
yarn add @probot/pino
bun add @probot/pino
```

Provides the command `pino-probot`.

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 5.0.1 |
| Published | 2025-07-31 |
| First published | 2020-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 4 |
| Unpacked size | 38.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 10 |
| Author | Gregor Martynus |
| Maintainers | bkeepers, hiimbex, lee-dohm, tcbyrd, jasonetco, gr2m, probotbot |
| Keywords | pino |

## Links

- npm: https://www.npmjs.com/package/@probot/pino
- Repository: https://github.com/probot/pino
- Homepage: https://github.com/probot/pino#readme
- Issues: https://github.com/probot/pino/issues
- npm.io page: https://npm.io/package/@probot/pino

## Dependencies (4)

- [pump](https://npm.io/package/pump.md) ^3.0.0
- [split2](https://npm.io/package/split2.md) ^4.0.0
- [pino-pretty](https://npm.io/package/pino-pretty.md) ^13.0.0
- [npx-import-light](https://npm.io/package/npx-import-light.md) ^1.0.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 5.0.1 (latest) — 2025-07-31
- 3.0.0-beta.6 (beta) — 2025-01-30
- 5.0.0 — 2025-07-09
- 4.0.2 — 2025-05-27
- 4.0.1 — 2025-05-27
- 4.0.0 — 2025-01-31
- 3.0.0 — 2025-01-30
- 3.0.0-beta.5 — 2025-01-28
- 3.0.0-beta.4 — 2025-01-28
- 3.0.0-beta.3 — 2024-10-16
- 3.0.0-beta.2 — 2024-10-16
- 2.5.0 — 2024-10-15
- 3.0.0-beta.1 — 2024-08-29
- 2.4.0 — 2024-08-29
- 2.3.5 — 2021-10-14
- … 18 more at https://npm.io/package/@probot/pino/versions

## README

# `@probot/pino`

> formats [pino](https://github.com/pinojs/pino) logs and sends errors to [Sentry](https://sentry.io)

## About

`@probot/pino` is currently built into `probot`, you don't need to manually pipe probot's logs into it. It will be easy to move it out of `probot` in future though, and give people a simple way to recover the logging behavior if they wish, or to replace it with another [pino transport](https://getpino.io/#/docs/transports)

## CLI Usage

```
node my-script.js | pino-probot
```

You can test the environment variables by setting them inline

```
node my-script.js | LOG_FORMAT=json pino-probot
```

## Programmatic usage

`@probot/pino` exports a `getTransformStream()` async function which can be passed as 2nd argument to `pino()`

```js
import pino from "pino";
import { getTransformStream } from "@probot/pino";

const log = pino(
  {
    name: "probot",
  },
  await getTransformStream(),
);
```

This won't log anything to stdout though. In order to pass the formatted logs back to stdout, do the following

```js
import pino from "pino";
import { getTransformStream } from "@probot/pino";

const transform = await getTransformStream();
transform.pipe(pino.destination(1));
const log = pino(
  {
    name: "probot",
  },
  transform,
);
```

With custom options:

```js
const transform = await getTransformStream({
  logFormat: "json",
  logLevelInString: true,
  sentryDsn: "http://username@example.com/1234",
});
```

### Options

The `pino-probot` binary can be configured using environment variables, while the `getTransformStream()` accepts an object with according keys

| Environment Varibale  | Option             | Description                                                                                                                                                                                              |
| --------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LOG_FORMAT`          | `logFormat`        | Set to `pretty` or `json`. When set to `pretty`, logs are formatted for human readability. Setting to `json` logs using JSON objects. Defaults to `pretty`                                               |
| `LOG_LEVEL_IN_STRING` | `logLevelInString` | By default, when using the `json` format, the level printed in the log records is an int (`10`, `20`, ..). This option tells the logger to print level as a string: `{"level": "info"}`. Default `false` |
| `SENTRY_DSN`          | `sentryDsn`        | Set to a [Sentry](https://sentry.io/) DSN to report all errors thrown by your app. <p>_(Example: `https://1234abcd@sentry.io/12345`)_</p>                                                                |

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md)

## License

[ISC](LICENSE)

---
_Source: https://npm.io/package/@probot/pino · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
