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

Can't use pino logger "The logger instance should have these functions" #618

Open
2 tasks done
bodinsamuel opened this issue Apr 20, 2023 · 1 comment
Open
2 tasks done

Comments

@bodinsamuel
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.15.0

Plugin version

4.0.0

Node.js version

18.13

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

13.2

Description

Since upgrading to 4.15.0, my fastify api can't boot anymore.
It throws: Invalid logger object provided. The logger instance should have these functions(s): 'child'

I use Pino, so the one logger that is recommended.

Change was probably introduced here:
fastify/fastify#4657
fastify/fastify#4520

Bug is probably related to:
#574

Honestly I don't know, between fastify and cli, who's responsible for this bug report, feel free to move it.

Steps to Reproduce

# Logger.ts
import { pino } from 'pino';

export const logger = pino({
  level: 'info',
});

# app.ts
export const options: FastifyServerOptions = {
  logger,
};
fastify start --logging-module='build/logger.js' -o -w -P build/app.js

Expected Behavior

Working

@mcollina mcollina transferred this issue from fastify/fastify Apr 25, 2023
@mcollina
Copy link
Member

I think this is a duplicated of #574.

@Eomm could you confirm?

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