I want to run a node application via systemd
and have its output go to both stdout and a log file. The node app is in the folder named www/www.appname.com
and I want to have the log file in www/log.appname.com
. I have the following service servicename
defined:
[Service]
ExecStart=/usr/bin/node server | tee -a ../log.appname.com/appname.service.log
KillMode=process
Restart=always
RestartSec=20
WorkingDirectory=/home/username/www/www.appname.com
[Install]
WantedBy=default.target
But when I run my service, e.g.
systemctl --user restart servicename
Then the folder www/log.appname.com
remains blank, so maybe there's something wrong with the path name I'm using in the tee
?