I have a service, i can see the log in /var/log/messages or with journalctl -u my_service
Code: Select all
[Unit]
Description=my_service
Requires=service1.service service2.service
After=service1.service service2.service
[Service]
ExecStart=/usr/bin/java -jar /tmp/test.jar
SuccessExitStatus=143
[Install]
WantedBy=default.target
Code: Select all
ExecStart=/usr/bin/java -jar /tmp/test.jar 1>/tmp/test.log 2>&1
How to configure it to log also in /var/log/my_service.log or a custom path /my_path/my_service.log
Thanks for your help.