How to redirect output of systemd service to a file

I am trying to redirect output of a systemd service to a file but it doesn’t seem to work: [Unit] Description=customprocess After=network.target [Service] Type=forking ExecStart=/usr/local/bin/binary1 agent -config-dir /etc/sample.d/server StandardOutput=/var/log1.log StandardError=/var/log2.log Restart=always [Install] WantedBy=multi-user.target Please correct my approach. 8 Answers 8