-
Notifications
You must be signed in to change notification settings - Fork 912
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
[RFC] core: notify plugins when a log line is emitted #6990
[RFC] core: notify plugins when a log line is emitted #6990
Conversation
832805a
to
e46eb96
Compare
e46eb96
to
ad23657
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for reviewing a draft, but the PR caught my attention, since it's something I have been looking into as well.
The choice of augmenting the warning
notification seems a bit strange, shouldn't the log
topic contain all logs, and warning
logs be replicated. We should try to avoid coupling semantics of different things together.
One major issue with the log
notification is the fact that it trivially produces infinite recursions: print a log line while handling a log
notification and voila, you just caused a deadlock in the form of an infinite recursion.
We should track the origin of logs, and not deliver logs originating from log
subscribers to other log
subscribers. That even fixes the problem of two plugins playing seesaw, by seeing each other's log messages produced during log processing :-)
Also, this is a draft, so please do not attach a milestone to it. Milestones are for the release captain to signal their intent to include a PR in a release, not for maintainers and developers to just tag and throw things over the wall. |
I forgot to turn on this, I was fighting with the CI and did not realize that the last push was finding the CI. So I guess this is ready to be review and I would love that you consider the inclusion inside this release if possible 😄 |
Yes but this is true also for hooks, we can write the hook in a way that will create a loop. The idea here for this PoC is that the OFC I can add a |
I don't think that'll be necessary. These deadlocks should be pretty evident, and we can add the extra warning later. I'd still like the warnings to also end up in the |
Thank you. I would like to clarify that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please decouple the log
from the warning
topic. log
should contain every log event, while warning
should receive only a subset of the logs. We can add deadlock-protection in a separate step.
8faf8a8
to
d9ad513
Compare
Ok @cdecker this should be ready for another review, sorry for the delay |
d9ad513
to
f688b29
Compare
f688b29
to
4f56e8d
Compare
9fa51d3
to
034b858
Compare
Review addressed @cdecker Rebased to resolve some conflicts too! |
d3ec95a
to
a31e313
Compare
a31e313
to
8bc088b
Compare
Trivial rebase to resolve the |
8bc088b
to
0bb52b0
Compare
0bb52b0
to
4fc9e71
Compare
4fc9e71
to
bfbf4da
Compare
Trivial Rebase and I think this is ready for considering the inclusion
I am using this assumption and trying to fix the recursion later, for the simple fact that we have these recursion problems also for hooks, so we should design a detect loop solution that will work also for hooks, but IMHO this is unrelated to this PR |
bfbf4da
to
e779ffc
Compare
Currently make a plugin that do reportings of logs on a services like graphana is not possible. So this commit include the possibility to write a plugin that do the report of this analisys. Changelog-Added: core: notify plugins when a log line is emitted. Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Changelog-None: docs: adds documentation about the log notification Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
e779ffc
to
6c67b7b
Compare
b5cfd98
into
ElementsProject:master
While our logging is super flexible, we are missing a feature to give the power to a plugin to be notified about logging.
This is useful when you are deploying core lightning in production and want a dashboard where it is possible to monitor the log with proper tools like Graphana, or tracing information with a framework like open telemetry