Dedicated service logging
A dedicated service logger only logs the output coming from a single daemon. Dedicated logging is nice because diagnostic data for different services is distributed across separate log files. The monolithic log files generated by centralized system loggers such as syslogd
are often hard to untangle. Both forms of logging have their purpose: dedicated logging excels at readability and centralized logging offers context. Your services can each have their own dedicated loggers and still write to syslog
so you sacrifice neither.
How does it work?
Because service run
scripts run in the foreground, adding a dedicated logger to a service only involves redirecting standard output from a service's run
to a log file. You enable dedicated service logging by creating a log
subdirectory inside the target service directory with another run
script inside of it. This additional run
is for the service's logger, not the service itself. When this log
directory...