DEV Community

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

Posted on

3

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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay