Skip to content

Conversation

@luismiramirez
Copy link
Contributor

@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 luismiramirez added enhancement An improvement to an existing feature. feature A new feature for this component. labels Oct 15, 2024
@luismiramirez luismiramirez self-assigned this Oct 15, 2024
@luismiramirez luismiramirez mentioned this pull request Oct 15, 2024
4 tasks
@luismiramirez
Copy link
Contributor Author

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

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

Labels

enhancement An improvement to an existing feature. feature A new feature for this component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants