-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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 option to use formatter inside systemd sink #2320
Comments
Sure, please open a pr.
I guess so, unless you will use the future version with the formatter in which case it must be mutex protected since the formatter is not thread safe. |
Great, thanks!
Oh, yeah, I didn't realize the formatters weren't thread-safe for optimization reasons. I was hoping to avoid different threads blocking each other, but it's certainly negligible in view of the overall performance of |
Add option to enable formatting of systemd sink
Hi.
We are migrating from
file_sink
tosystemd_sink
and we would like to preserve thespdlog
format. It's dropped (by design, I understand) during conversion becausejournald
implements its own structured logging. That makes sense, but we're losing some important fields in the process.Basically, I'm looking #1289 but using the alternative approach proposed.
That is, adding a boolean to constructor and re-implement #1107 for
systemd_sink
.I understand that I can create my own sink to implement it this way, but I having this feature upstream is of course preferable (avoid duplication and guarantees further updates).
I can definitely open a Pull Request if you think this is an acceptable addition.
I have also just one question:
sd_journal_send()
being thread safe, does that mean I can safely usesystemd_sink_st
in a multi-threaded environment with multiple loggers? Is there any reason to prefersystemd_sink_mt
?The text was updated successfully, but these errors were encountered: