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 an ability to set keys for time and level #39

Open
paulish opened this issue Dec 16, 2021 · 1 comment
Open

Add an ability to set keys for time and level #39

paulish opened this issue Dec 16, 2021 · 1 comment

Comments

@paulish
Copy link

paulish commented Dec 16, 2021

Hello.

I have an issue with using @elastic/ecs-pino-format package together with pino-pretty which uses pino-abstract-transport internally.

The problem is that @elastic/ecs-pino-format use custom formatters which changes time field to @timestamp and level to log.level. As result pino-abstract-transport can not fulfill metadata object correctly because of this code:

    if (stream[metadata]) {
      stream.lastTime = value.time
      stream.lastLevel = value.level
      stream.lastObj = value
    }

Here the library takes hard-coded time and level fields and gives no options to override this behavior.

@mcollina
Copy link
Member

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants