Code snippets to accompany How-To: Tail Apache logs to Ubuntu Notifications on http://insidethe.agency/
Original Article: http://insidethe.agency/blog/how-to-tail-apache-logs-to-ubuntu-notifications
Code snippets to accompany How-To: Tail Apache logs to Ubuntu Notifications on http://insidethe.agency/
Original Article: http://insidethe.agency/blog/how-to-tail-apache-logs-to-ubuntu-notifications
sh watch-apache-log.sh > /dev/null 2>&1 & |
#!/bin/sh | |
apache_log() { | |
while inotifywait -e modify /var/log/apache2/error.log; do | |
line=$(tail -n1 /var/log/apache2/error.log | cut -c 81-); | |
notify-send "$line"; | |
done | |
} | |
apache_log & |
#!/bin/sh | |
apache_log() { | |
while inotifywait -e modify /var/log/apache2/*.error.log; do | |
line=$(tail -n1 /var/log/apache2/*.error.log | cut -c 81-); | |
notify-send "$line"; | |
done | |
} | |
apache_log & |
#!/bin/sh | |
apache_log() { | |
while inotifywait -e modify /var/log/apache2/error.log; do | |
line=$(tail -n1 /var/log/apache2/error.log | cut -c 81-); | |
notify-send "$line"; | |
done | |
} | |
mail_log() { | |
while inotifywait -e modify /var/log/mail.log; do | |
line=$(tail -n1 /var/log/mail.log); | |
notify-send "$line"; | |
done | |
} | |
apache_log & | |
mail_log & |