Download the PHP package saasscaleup/laravel-log-alarm without Composer
On this page you can find all versions of the php package saasscaleup/laravel-log-alarm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download saasscaleup/laravel-log-alarm
More information about saasscaleup/laravel-log-alarm
Files in saasscaleup/laravel-log-alarm
Package laravel-log-alarm
Short Description Laravel log Alarm help you to set up alarm when errors occur in your system and send you a notification via Slack and email
License MIT
Homepage https://github.com/saasscaleup/laravel-log-alarm
Informations about the package laravel-log-alarm
Real-time Log Monitoring and Error Detection for Your Laravel Applications
Youtube
·
Twitter
·
Facebook
·
Buy Me a Coffee
Log Alarm for Laravel
Log Alarm is a robust and easy-to-use Laravel package designed to enhance your application's logging capabilities. Whether you're running a small web app or a large enterprise system, Log Alarm helps you stay on top of your logs by providing real-time monitoring, error detection, and instant notifications via Slack and email.
✨ Features
- Real-time Log Monitoring: Continuously listen for log events and keep track of your application's health.
- Error Detection: Automatically detect and respond to error log events.
- Customizable Notifications: Send instant notifications to Slack and email when errors occur.
- Frequency Control: Set thresholds and delays to avoid notification flooding.
- Cache-based Alert System: Efficiently track error occurrences without the overhead of database operations.
- Flexible Configuration: Easily configure settings and specify error conditions with custom strings.
Why Choose Log Alarm?
In today's fast-paced digital environment, timely responses to application issues are crucial. Log Alarm ensures that you and your team are promptly informed about critical errors, reducing downtime and improving your application's reliability. Perfect for developers, system administrators, and DevOps teams looking to enhance their monitoring capabilities.
Requirements
- PHP >= 7
- Laravel >= 5
⬇️ Installation
Install the package via Composer:
For Laravel < 5.5
Add Service Provider to config/app.php
in providers
section
Publish package's config file
Publish package's config, migration and view files by running below command:
Usage
The package will automatically start listening to your application's log events. Customize the settings in the config/log-alarm.php
file to match your requirements.
For Example:
In order to trigger the Log Alarm with the current defualt setting, All you need to do is
- Add your
LA_SLACK_WEBHOOK_URL
andLA_NOTIFICATION_EMAIL
- Print Error log 5 times in
tinker
or in yourController
Telegram Notification Configuration
Add LA_TELEGRAM_BOT_TOKEN
and LA_TELEGRAM_CHAT_ID
to your .env
Getting a Bot Token:
- Open Telegram and search for
@BotFather
- Start a chat with BotFather and send
/newbot
- Follow the prompts:
- Provide a name for your bot
- Provide a username for your bot (must end in 'bot'). Example:
MyTelegramBot
ormy_telegram_bot
- BotFather will give you a bot token that looks like this:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Getting the Chat ID:
Method 1 (For Direct Messages):
- Start a chat with your new bot
- Send it any message
-
Visit this URL in your browser (replace with your bot token):
- Look for the "chat" -> "id" field in the JSON response. It will be a number like
123456789
.
Method 2 (For Groups):
- Add your bot to the group
- Send a message in the group
- Use the same /getUpdates URL method above
- Look for "chat" -> "id" in the response. For groups, it will be a negative number like -123456789
Important Tips:
Keep your bot token secret - anyone with it can control your bot For groups, make sure to give the bot permission to read messages If you don't see any updates in the /getUpdates response, send a new message to the bot or group The chat ID is permanent for that chat or group unless the bot is removed and re-added
Tinker example:
After the fifth error log message, email and slack notification will be sent! (Email example)
🔧 Configuration
Update your .env
file with the following environment variables:
Here's the full configuration file content for config/log-alarm.php
:
Contribution
We welcome contributions! Please feel free to submit a Pull Request or open an Issue on GitHub.
License
This package is open-sourced software licensed under the MIT license.
Support 🙏😃
If you Like the tutorial and you want to support my channel so I will keep releasing amzing content that will turn you to a desirable Developer with Amazing Cloud skills... I will realy appricite if you:
Thanks for your support :)
Enhance your Laravel application's monitoring capabilities today with Log Alarm. Get started by installing the package and experience improved error management and faster response times.