jordansissel / pleaserun

An attempt to abstract this "init" script madness.
Other
1.17k stars 75 forks source link

logfile support #56

Open mailinglists35 opened 10 years ago

mailinglists35 commented 10 years ago

I found this https://gist.github.com/naholyr/4275302 and I was wondering if any functionality of it can be used in pleaserun. For example, the possibility of opening a log file is a missing feature in pleaserun.

jordansissel commented 10 years ago

Logging is actually one of the things I definitely am including in pleaserun. It's not currently configurable, but the init scripts generated (and any other daemon service configs) should support a default log setting.

Check out here: https://github.com/jordansissel/pleaserun/blob/master/templates/sysv/lsb-3.1/init.sh#L60

This tells stdout to write to /var/log/NAME.log and stderr to write to /var/log/NAME.log

josegonzalez commented 8 years ago

This is what we do for logging in upstart:

script
  exec su -s /bin/bash \
    -c "SERVICE_COMMAND" \
    SERVICE_USER \
    >> /var/log/SERVICE_NAME/SERVICE_TYPE-SERVICE_COUNT-stdout.log \
    2>> /var/log/SERVICE_NAME/SERVICE_TYPE-SERVICE_COUNT-stderr.log
end script

Some notes: