# @bsb/observable-pino

> Pino observable plugin for BSB - high-performance JSON logger integration

Latest version **9.7.4** (published 2026-09-26) · (AGPL-3.0-only OR Commercial) license · 0 weekly downloads

## Install

```sh
npm install @bsb/observable-pino
pnpm add @bsb/observable-pino
yarn add @bsb/observable-pino
bun add @bsb/observable-pino
```

## Health

**Score 75/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.7.4 |
| Published | 2026-09-26 |
| First published | 2026-02-22 |
| Weekly downloads | 0 |
| License | (AGPL-3.0-only OR Commercial) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24.0.0 |
| Dependencies | 4 |
| Unpacked size | 60.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3 |
| Author | BetterCorp |
| Maintainers | mrinc, betterninja |
| Keywords | bsb, observable, logging, pino, performance |

## Links

- npm: https://www.npmjs.com/package/@bsb/observable-pino
- Repository: https://github.com/BetterCorp/better-service-base
- Homepage: https://io.bsbcode.dev/packages/nodejs/@bsb/observable-pino
- Issues: https://github.com/BetterCorp/better-service-base/issues
- npm.io page: https://npm.io/package/@bsb/observable-pino

## Dependencies (4)

- [pino](https://npm.io/package/pino.md) ^10.3.1
- [anyvali](https://npm.io/package/anyvali.md) ^1.1.5
- [@bsb/base](https://npm.io/package/@bsb/base.md) ^9.1.11
- [pino-pretty](https://npm.io/package/pino-pretty.md) ^13.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

- 9.7.4 (latest) — 2026-09-26
- 9.7.3 — 2026-09-12
- 9.7.2 — 2026-09-10
- 9.7.1 — 2026-09-10
- 9.7.0 — 2026-09-09
- 9.6.99 — 2026-09-05
- 9.6.98 — 2026-09-05
- 9.6.97 — 2026-09-03
- 9.6.96 — 2026-09-03
- 9.6.95 — 2026-09-02
- 9.6.94 — 2026-09-02
- 9.6.93 — 2026-09-02
- 9.6.92 — 2026-09-02
- 9.6.91 — 2026-09-02
- 9.6.90 — 2026-09-02
- … 78 more at https://npm.io/package/@bsb/observable-pino/versions

## README

# @bsb/observable-pino

Pino observable plugin for BSB providing high-performance JSON logging with minimal overhead.

## Key Features

- High performance with async logging
- Structured JSON output by default
- Pretty printing for development
- Custom transports with Pino's ecosystem
- Built-in serializers for errors and objects
- Automatic sensitive data redaction

## Installation

```bash
npm install @bsb/observable-pino
```

## Configuration

Add the plugin to your BSB configuration file:

```yaml
plugins:
  observables:
    - plugin: "@bsb/observable-pino"
      enabled: true
      config:
        level: "info"
        prettyPrint:
          enabled: false
          colorize: true
          translateTime: "SYS:standard"
          ignore: "pid,hostname"
        transport:
          enabled: false
          target: "pino/file"
          options:
            destination: "./logs/app.log"
        serializers:
          error: true
        base:
          app: "my-service"
        redact:
          - "password"
          - "token"
          - "apiKey"
```

### Configuration Options

| Option | Description | Default |
|--------|-------------|---------|
| `level` | Minimum log level | `info` |
| `prettyPrint.enabled` | Enable development-friendly formatting | `false` |
| `prettyPrint.colorize` | Colorize pretty output | `true` |
| `prettyPrint.translateTime` | Human-readable timestamps | `SYS:standard` |
| `transport` | Custom Pino transport configuration | Disabled |
| `serializers.error` | Enable error/object serialization | `true` |
| `base` | Default fields included in all logs | `{}` |
| `redact` | Array of field paths to redact | `[]` |

## Usage

Once configured, logs are handled by Pino automatically:

```typescript
this.log.info("Service initialized");
this.log.error("Error occurred", new Error("Something went wrong"));
```

## JSON Output Example

```json
{
  "level": 30,
  "time": 1706984400000,
  "app": "my-service",
  "msg": "Service initialized",
  "traceId": "abc123",
  "spanId": "def456"
}
```

## Documentation

Detailed documentation (used by the BSB Registry): `https://github.com/BetterCorp/better-service-base/blob/master/plugins/nodejs/observable-pino/docs/plugin.md`

## Links

- GitHub: `https://github.com/BetterCorp/better-service-base/tree/master/plugins/nodejs/observable-pino`
- BSB Registry (package): `https://io.bsbcode.dev/packages/nodejs/@bsb/observable-pino`

## License

Dual-licensed under AGPL-3.0-only OR Commercial License.

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