-
Notifications
You must be signed in to change notification settings - Fork 289
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
Emit kafka C library logs as tracing events #663
Comments
The logs from |
@davidblewett overriding the In any case, I'm still seeing these logs from the C library:
I'm wondering what the entry point for these logs is on the Rust side and how I can emit them as |
Sigh, you're right. I had forgotten about that. It was my understanding that the logging callback is the only spot. Are you passing in debug contexts perhaps? I would assume those would also flow through the |
I am passing in a custom context because I need to override some methods for |
I think this PR can help: #655 |
I'm fairly new to Rust and I've been trying to emit the C library kafka logs as tracing events, similar to what we can do with rust-rdkafka logs if we set the tracing feature for the crate (https://github.com/fede1024/rust-rdkafka?tab=readme-ov-file#:~:text=rust%2Drdkafka%20uses%20the%20log%20crate%20to%20handle%20logging.%20Optionally%2C%20enable%20the%20tracing%20feature%20to%20emit%20tracing%20events%20as%20opposed%20to%20log%20records.)
i.e. I am able to see these logs as tracing events:
2024-03-27T20:00:42.645780Z TRACE foo: rdkafka::util: Destroyed client: REDACTED
What I want is these logs to be emitted as tracing events as well (sorry for REDACTED data, I'm not sure how much of this is sensitive):
Is that even possible? I came across this function
rd_kafka_conf_set_log_cb
but I'm not sure if I can get it to work from Rust.The text was updated successfully, but these errors were encountered: