DEV Community

Cover image for Add notification for your log file / directory to monitor it
Ahmed Helal
Ahmed Helal

Posted on

Add notification for your log file / directory to monitor it

Story

Everyday we are working on a project maybe we develop some features or fixing bugs may be there is error occur that not shown in the screen and this will log in log files for example in "/storage/logs/laravel.log" and we need to open this file to know more info about the issue

Nice Idea

How about hear a song or a notification if this file change or any file in storage/log directory it will be nice is that right?

Let's do it

  • Make new file in /usr/local/bin with name log add its content from the file with name log
  • Add execution ability to it by: sudo chmod +x log
  • Add the song file with name new_log.mp3 in /usr/local/bin
  • Open terminal in for example laravel project(example-app): log /var/www/html/example-app/storage/logs/laravel.log or log /var/www/html/example-app/storage/logs

Note

You maybe need to install some packages i mentioned in packages in Source code

Source code

Idea Source

Top comments (0)