-
Notifications
You must be signed in to change notification settings - Fork 103
Add configurable logger #393
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
Add configurable logger #393
Conversation
b3761eb
to
b0e7fef
Compare
Thanks for looking into this and I def. agree we need to add the capability for custom loggers (see #309) but I'm not sure we want to go with the approach chosen here. As described over at #309, we probably want to try using the Let me know if that makes sense and also what additional requirements you see for a custom logger interface. If you intend to keep working on this, you might want to coordinate with @enigbe which just recently indicated interest in working on it / #309, too. |
Ah, I see. I was trying to avoid taking a dependency, but if you've already decided you want to use We originally did this in our local fork, as we can only see stdout logs right now. We can keep running with our fork until #309 is resolved. As far as requirements I'd like to see for #309:
eta:
That would be very trivially reversed, and that should hold true for any implementation that's extensible enough. Maybe that's a good litmus test for customization, as well. |
Yes, we probably will go this way at least here in LDK Node, but possibly also at least optionally upstream as users keep stumbling across the fact that LDK doesn't use
Right, you can also expose trait objects arguments via
Cool, thanks. Will keep these in mind! My goal for now is to end up with a slightly improved |
Heh, I tried this as well, too bad I tossed the commit. I think that would work as well, although it left me writing some awkward documentation ... along the lines of, "If you specify this, these other logging fields from config are ignored." |
P.S. -- If you do this, give some thought to the |
Yeah, that's a good point, maybe even more so regarding the upstream changes as we might need |
Description
Adds logger configuration to
ldk-node
.Motivation
The first impulse for this was to be able to write to stdout, as that's more desirable for some containerized infrastructure. But rather than add a specific stdout implementation, we thought it better to make this extensible to write to arbitrary destinations (for example, a network log ingester). This additionally has the benefit of letting you customize how the writing happens; for example the
tracing-appender
crate uses anmpsc
for writers, with a single thread performing all the actual I/O off of the queue.Details
The PR has three commits:
Config
struct itself. Users of the::default()
configuration should see no change in behavior.