[systemd-devel] 回复: Is it possible to send a string to the journal of one specific systemd unit

Stefan Tatschner stefan at rumpelsepp.org
Sat Oct 23 07:32:15 UTC 2021


On Fri, 2021-10-22 at 08:42 +0000, DHAIY DHAIY wrote:
> But is there a way to insert one string from command-line into
> myservice's journal so that it can be seen byjournalctl -u myservice
> later

Try this:

$ echo "foo" | systemd-cat -t foobar

Then you can access your string with:

$ journalctl -t foobar

S



More information about the systemd-devel mailing list