3 ms·
How do you set cron to post to Slack?
by mkopinsky 10y ago
How do you set cron to post to Slack?
- ancarda 10y agoWe use Monolog (PHP library) that is able to post to Slack. Messages in Monolog, like syslog have a level attached, so DEBUG, INFO, NOTICE and WARNING will only be written to a log file on disk. Anything higher, so ERROR, CRITICAL, ALERT or EMERGENCY will write to Slack (as well as log to disk). This means we only get notified of things failing and we can go on the server and see everything from DEBUG upwards which lets us mentally step through the cron job's run. It's a very cool library. https://github.com/Seldaek/monolog https://github.com/Seldaek/monolog You can see the handlers here: https://github.com/Seldaek/monolog/tree/master/src/Monolog/Handler https://github.com/Seldaek/monolog/tree/master/src/Monolog/H... which includes Slack, HipChat, IFTTT, Pushover, etc...