pinojs / pino

🌲 super fast, all natural json logger
http://getpino.io
MIT License
14.21k stars 875 forks source link

sonic boom is not ready yet #2013

Closed dicolasi closed 3 months ago

dicolasi commented 3 months ago

I have the following configuration, where I would like to save logs to a file and print them on console.

import pino from 'pino';
import { LogLevel } from './types/log-level';

require('pino')('/path/to/file');

const logger = pino({
  level: process.env.EXCHANGE_PUBLISH_LOG_LEVEL || 'info',
  customLevels: {
    success: 31,
    question: 35
  },
  safe: true,
  transport: {
    targets: [
      {
        target: 'pino/file',
        options: {
          destination: '/path/to/file',
          mkdir: true,
          appendFile: false
        }
      },
      {
        target: 'pino-pretty',
        options: {
          colorize: true,
          levelFirst: true,
          ignore: 'hostname,pid,time',
          customLevels: 'success:31,question:35',
          customColors: 'success:greenBright,question:gray',
          useOnlyCustomProps: false
        }
      }
    ]
  }
});

However, I have the following error when I try to start the application:

    throw new Error('sonic boom is not ready yet')
    ^

Error: sonic boom is not ready yet
    at SonicBoom.flushSync (/Users/simone.dicola2/WebstormProjects/publishing-tools/node_modules/sonic-boom/index.js:526:11)
    at autoEnd (/Users/simone.dicola2/WebstormProjects/publishing-tools/node_modules/pino/lib/tools.js:286:12)
    at callRefs (/Users/simone.dicola2/WebstormProjects/publishing-tools/node_modules/on-exit-leak-free/index.js:55:7)
    at process.onExit (/Users/simone.dicola2/WebstormProjects/publishing-tools/node_modules/on-exit-leak-free/index.js:39:3)
    at process.emit (node:events:529:35)
    at process.emit (node:domain:489:12)
    at process.emit.sharedData.processEmitHook.installedValue [as emit] (/Users/simone.dicola2/WebstormProjects/publishing-tools/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
    at process.exit (node:internal/process/per_thread:191:15)
    at process.emit.sharedData.processEmitHook.installedValue [as emit] (/Users/simone.dicola2/WebstormProjects/publishing-tools/node_modules/@cspotcode/source-map-support/source-map-support.js:750:17)
    at process._fatalException (node:internal/process/execution:169:25)

Node.js v18.20.2

I am using the following versions:

    "pino": "9.3.1",
    "pino-pretty": "11.2.1",
dicolasi commented 3 months ago

silly mistake, there was a typo in the import.

github-actions[bot] commented 2 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.