You can accomplish this using the method discussed in this SF Q&A titled: How can I send a message to the systemd journal from the command line?. This method uses the tool systemd-cat
which is similar in functionality to logger
.
$ echo 'hello' | systemd-cat -p info
$ echo 'hello' | systemd-cat -p warning
$ echo 'hello' | systemd-cat -p emerg
Messages would show up like this in journald:
Feb 07 13:38:33 localhost.localdomain cat[15162]: hello
You can control the identifier details that show up in the logs like this:
$ echo 'hello' | systemd-cat -t someapp -p emerg
Resulting in this type of logging:
Feb 07 13:48:56 localhost.localdomain someapp[15278]: hello
NOTE: I'd still probably implement this using an actual systemd unit file designed to capture the logs of Nginx.