2

Is there some way to change the logging library or at least the logging format? I need a way of having the logs output in JSON format.

What I tried: Installed the tracing-subscriber pallet with json feature and inside node/src/main.rs added the initialization, but it clashes with the built-in logger. Then I tried disabling it on sp-api with feature disable-logging but it stills crashes on node start.

Any helpful idea or insight?

1 Answer 1

1

Replacing the logger with the current code seems to be challenging. However, there is a create_runner_with_logger_hook available. Perhaps configuring the log profile could help achieve this.

https://github.com/paritytech/substrate/blob/b7c18f1f5c9dc5c4ffa683e230303f084efe82cb/client/cli/src/lib.rs#L234 https://github.com/paritytech/polkadot/blob/7f0eb5f06e4a403b10be1f7893859dde79f4d813/cli/src/command.rs#L239

1
  • 1
    Thanks for the response! As far as I see, that's only for metrics and profiling, don't see a way to configure the log format. Commented Aug 25, 2023 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.