Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pino transport #1134

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Add Pino transport #1134

merged 1 commit into from
Oct 15, 2024

Conversation

luismiramirez
Copy link
Member

@luismiramirez luismiramirez commented Oct 15, 2024

A Pino transport is now exposed from the package
(AppsignalPinoTransport). It requires an initialized AppSignal client to work, and also accepts a group as an optional parameter.

Attributes are flattened so no data is lost.

Usage:

import pino from "pino"
import { Appsignal, AppsignalPinoTransport } from "@appsignal/nodejs"

const logger = pino(
  AppsignalPinoTransport({
    client: Appsignal.client,
    group: "my-group",
  })
)

Samples from a Fastify test app:

Simple request:

image

Error:

image

Part of #828

@luismiramirez
Copy link
Member Author

Thanks @duailibe! I took inspiration from your https://github.com/duailibe/pino-appsignal-transport

src/pino_transport.ts Outdated Show resolved Hide resolved
src/pino_transport.ts Outdated Show resolved Hide resolved
A Pino transport is now exposed from the package
(`AppsignalPinoTransport`). It requires an initialized AppSignal client
to work, and also accepts a group as an optional parameter.

Attributes are flattened so no data is lost.

Usage:

```js
import pino from "pino"
import { Appsignal, AppsignalPinoTransport } from "@appsignal/nodejs"

const logger = pino(
  AppsignalPinoTransport({
    client: Appsignal.client,
    group: "my-group",
  })
)
```
@duailibe
Copy link

Glad it could be of some help!

Great work! I'll migrate from my own thing once this gets released

@luismiramirez luismiramirez merged commit 87853d7 into main Oct 15, 2024
29 checks passed
@luismiramirez luismiramirez deleted the pino-support branch October 15, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants