-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Use threadId
of worker_thread when logging inside worker thread
#9281
Comments
is anyone working on this ? If not I would gladly give it a shot. |
@stanimirovv I guess it's better to wait Kamil's thoughts on this feat. I'd prefer this to be always enable, therefore you would just do a minor change below:
Also, to me, the thread id should be displayed only if thanks :) |
I'd say we should just make it somehow simpler to extend the current format of the messages so people who want to add certain details (such as a thread id) could extend the built-in logger and tweak 1 method. I suppose extracting the logic responsible for formatting messages (that's is now hardcoded in the PRs are more than welcome! |
On it |
Let's track this here #9316 |
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
This isn't critical but could help out with working out logs.
I have an app that delegates jobs via pull to workers that run with
worker_threads
.When logging, there's no indication that the log is emitted from a worker thread (compared to the main thread).
Example log:
Describe the solution you'd like
I'd be happy if, optionally, the logger would append the thread id to (f.e) the PID, like so:
Where
1
is the thread id.Teachability, documentation, adoption, migration strategy
If this won't be turned on by default, perhaps this can be activated via a method as follows:
What is the motivation / use case for changing the behavior?
Ability to better understand and differentiate logs coming from worker threads.
I do believe the same might apply to
cluster
f.e, I didn't use it but I assume a similar problem might arise there.The text was updated successfully, but these errors were encountered: