I want to know how I count that how many times a critical error is occurred in a day so I can send to slack only when error occurred first time a day than 10th error a day.
also how to keep log file size to 5 Mb without using logrotate I am on shared hosting that's why I cannot use logrotate ?
what i want to do is this
If error occurred first time in that day than send it to slack
if error occurred the 10th times in that day than send it to slack
if error occurred the 100th times in that day than send it to slack
I don't want to send log each time it occurred because slack has limit per month
@newlearner2 You could consider using Bugsnag. It'll record all your errors and the frequencies, along with a bunch of other useful information.You then have the option of completely ridding yourself of the log file, if you desire. It also has different settings, but by default it'll only notify upon the first occurrence of an error, which is what you're looking for. You can also configure your Bugsnag project to post to Slack.