Getting inspiration from what you are proposing, you can already forward messages to a datagram socket (syslog). You could implement a program to empty out the datagram socket and only write the messages you want. Syslog format doesnt know anything about FIELD though. One down side of this implementation is that your program will be woken up for every message causing extra context switch.<div><br></div><div>Regardless off this, it is interesting to hear out the thoughts about filtering. There have been discussions about per service filtering too.</div><div><br></div><div>Umut <br><br>On Friday, March 13, 2015, Chris Morgan <<a href="mailto:chmorgan@gmail.com">chmorgan@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello.<br>
<br>
I posted this, <a href="http://lists.freedesktop.org/archives/systemd-devel/2013-July/011926.html" target="_blank">http://lists.freedesktop.org/archives/systemd-devel/2013-July/011926.html</a>,<br>
some time ago about tiered logging for embedded systems.<br>
<br>
The goal is to guarantee that the flash memory will last the duration<br>
of the product by carefully controlling who writes to it.<br>
<br>
I'm back looking at the issue and wanted to re-open the discussion.<br>
<br>
One approach that came up would be to set "Storage=volatile", a limit<br>
of say "10MB" for the journal size, and then write a separate program<br>
that would filter out the journal entries and write them to a file on<br>
a physical disk. The filtering portion is required as we are using the<br>
journal to persist some important information that we'd like to log.<br>
We'd also like to preserve high priority messages but don't mind if we<br>
lose low priority ones across reboots.<br>
<br>
An upside of the external program is that we can filter on both high<br>
priority messages as well as those with specific "FIELD=value"<br>
entries. Downside is a custom format file and can't use journalctl to<br>
search through it, no log rotation, no size limits etc.<br>
<br>
At the time there was some thought of putting this into journald<br>
itself. I'm wondering how that would fit given the desire to use more<br>
complicated matching to decide which entries were put into the<br>
persisted journal.<br>
<br>
If it would fit inside of journald I'd be willing to implement it but<br>
we would need to come up with a way to configure the filtering, where<br>
the files are persisted etc. The filtering is a new requirement since<br>
the last time this was discussed.<br>
<br>
Chris<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'systemd-devel@lists.freedesktop.org')">systemd-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</blockquote></div>