You possibly get this error:
Failed to parse output specifier, ignoring: /var/log1.log
From the systemd.exec(5)
man page:
StandardOutput=
Controls where file descriptor 1 (STDOUT) of the executed processes is connected to. Takes one of
inherit
,null
,tty
,journal
,syslog
,kmsg
,journal+console
,syslog+console
,kmsg+console
orsocket
.
The systemd.exec(5)
man page explains other options related to logging. See also the systemd.service(5)
and systemd.unit(5)
man pages.
Or maybe you can try things like this (all on one line):
ExecStart=/bin/sh -c '/usr/local/bin/binary1 agent -config-dir /etc/sample.d/server 2>&1 > /var/log.log'