Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Linux: SystemD
(edit)
Revision as of 10:51, 4 April 2018
470 bytes added
,
10:51, 4 April 2018
no edit summary
Line 13:
Line 13:
Source:
Source:
[https://www.dynacont.net/documentation/linux/Useful_SystemD_commands/ Useful SystemD Commands]
[https://www.dynacont.net/documentation/linux/Useful_SystemD_commands/ Useful SystemD Commands]
+
+
== Log to syslog ==
+
Use the following properties in your systemd service unit file:
+
StandardOutput=syslog
+
StandardError=syslog
+
SyslogIdentifier=<your program identifier> # without any quote
+
+
Then, assuming your distribution is using rsyslog to manage syslogs, create a file in /etc/rsyslog.d/<new_file>.conf with the following content:
+
if $programname == '<your program identifier>' then /path/to/log/file.log
+
if $programname == '<your program identifier>' then ~
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version