[systemd]: How to configure service with their own log?

General support questions
Post Reply
cassyb
Posts: 1
Joined: 2017/04/17 22:17:46

[systemd]: How to configure service with their own log?

Post by cassyb » 2017/04/17 22:28:50

Hi,

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
I try

Code: Select all

ExecStart=/usr/bin/java -jar /tmp/test.jar 1>/tmp/test.log 2>&1
but redirection doesn't seem to work.

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.

Post Reply