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

Support for customized logging #487

Closed
crystalin opened this issue Sep 24, 2021 · 3 comments
Closed

Support for customized logging #487

crystalin opened this issue Sep 24, 2021 · 3 comments

Comments

@crystalin
Copy link

Ideally, the library should allow the user to control how the logs are produced.
Here is the requirements we believe are needed for our parachain node:

  • Support to log the request, including its payload*
  • Support to log the response, including its payload* and the timing
  • *Payload could be filtered (to include some fields, or based on the method used). The possibility to reduce the the content of the fields in the payout automatically (like an array of 1000 items displaying only the first and last item).
@librelois
Copy link

One possibility proposed by @dvdplm would be to integrate sc_tracing and allow users to inject their own tracing-subscriber.

@niklasad1
Copy link
Member

This is partly fixed by #722

It adds a tracing span per method name with a limit just to truncate logs bigger than n characters.
What's is nice is that you can subscribe to just a method name that you are interested in instead of doing it globally with middleware (unless you want to recompile and have some filter).

But we'll add more details in the middleware too soon so we can pick either because tracing is a bit less flexible for users as the logging output is simply truncated.

@niklasad1 niklasad1 added this to the v1.0 milestone Jun 23, 2022
@niklasad1
Copy link
Member

niklasad1 commented Jul 6, 2022

Closed by #793

jsonrpsee has both "tracing spans" and middleware for you to customize your logging.

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

3 participants