lucab / libsystemd-rs

A pure-Rust client library to work with systemd
https://crates.io/crates/libsystemd
Other
106 stars 19 forks source link

Multiline journal messages? #70

Closed swsnr closed 3 years ago

swsnr commented 3 years ago

I tried to send a multiline message to the journal, but it didn't appear in the journal.

Looking at the code this crate seems to just join all fields by newlines, but systemd seems to do something more intricate when a field value contains a line break, see https://github.com/systemd/systemd/blob/d65c5d04f9c6d6c943e67e677161caed782fe7a7/src/libsystemd/sd-journal/journal-send.c#L250

lucab commented 3 years ago

@lunaryorn indeed I forgot to implement that part of the logic, mostly because I didn't have any use for that so far. Would you like to tackle that in the near term, or should I keep this open and hopefully get back to it at some point?

swsnr commented 3 years ago

Would you like to tackle that in the near term

I can't make any promises :shrug:

swsnr commented 3 years ago

@lucab The fix turned out to be simple enough and I found a bit of spare time :slightly_smiling_face: