Skip to content

Node stacktrace on a single line? #6976

@justechn

Description

@justechn

I am just getting started with Node and Docker and I am trying to use the docker logging drivers for graylog. I have it working, but I ran into a problem when node prints out a stacktrace. Since docker sends each newline to graylog a stacktrace ends up split up in a bunch of separate logs.

I asked the docker group about this and they said they have no way of knowing when a log starts and ends, so they can't help.

I was wondering if there was a way to get node to output each error and debug on a single line in json object or something similar?

the logs in graylog look like this, which you can see is not helpful
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidIssues and PRs that are invalid.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions