Linux – How to disable logging for a particular systemd unit

linuxloggingsystemd

I have a systemd unit, which creates a lot of useless log (around 1GB per day), so I want to disable logging for this unit. How can I manage to do this? Thanks

Best Answer

I'm assuming it's logging by writing to standard out or standard error. In those cases, you can use StandardOutput=null or StandardError=null to send the output into the void.

See the systemd.exec(5) man page for more information on the directives.