Content-Length: 273201 | pFad | http://github.com/getsentry/sentry-javascript/issues/16737

4D Sentry Logs: Format Console Logs · Issue #16737 · getsentry/sentry-javascript · GitHub
Skip to content

Sentry Logs: Format Console Logs #16737

Open
@psteinroe

Description

@psteinroe

Problem Statement

Hey,

we are playing around with Sentry Logs. Right now, we log everything via console, and then push the container output to our logging service. The latter part (pushing via eg vector) is already worked in - this issue is about the first part: Properly sending the console logs to Sentry.

We have a little wrapper around console.log to have a unified log structure. All logs are printed as console.log("my message", { …context }) where the context could also contain eg a requestId, traceId or any other important data. I want them to properly show up in Sentry.

Solution Brainstorm

I looked through the implementation and it seems like sentry is simply concatenating all args before sending them as the message. It would be great if the integration would accept a format argument that would allow us to overwrite that and return attributes properly. Something along the lines of:

format (args: any[]): { message: string, attributes: Record<string, string> }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/getsentry/sentry-javascript/issues/16737

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy