subql icon indicating copy to clipboard operation
subql copied to clipboard

Make pino logger configurable via project.ts

Open livthomas opened this issue 1 year ago • 0 comments

Prerequisites

  • [x] Are you running the latest version(s)?
  • [x] Have you searched the documentation for your issue?
  • [x] Did you search for an existing issue or pull request?

Description

Right now, SubQuery allows only a very limited configuration of built-in pino logger. It is only possible to set log level and output format but there is no way to set custom transports or other logger options.

Expected behavior: project.ts file should have logger field of type pino.LoggerOptions which would be passed to the pino instance when it is being initialized in both the indexer and the GraphQL engine.

Actual behavior: It is only possible to choose whether logs are colored or json via --output-fmt parameter and set the log level via --log-level parameter.

Any other information

For example, I would like to configure the logger to send logs directly to Logtail (BetterStack Logs) instead of relying on syslog. There's @logtail/pino transport that I already use in my app code but I would also like to use it in the SubQuery app.

livthomas avatar Jan 30 '24 14:01 livthomas