Get a realtime feed of your Laravel project’s most important events using Logsnag.

Overview

laravel-logsnag

Latest Version on Packagist Total Downloads

Get a realtime feed of your Laravel project’s most important events using Logsnag. Supports push notifications straight to your phone.

Get notified:

  1. In the Logsnag dashboard.
  2. On your desktop/laptop (windows + macOS).
  3. On your phone (android + iOS).

Support me

I create Open Source software in my spare time. If you wish to support me, consider buying me a coffee :).

Buy Me a Coffee at ko-fi.com

Beta

Logsnag is currently in beta mode, and you must join the waitlist in order to use it. However, they accept people fairly quickly. Join on their website here: https://logsnag.com/.

Requirements

  • PHP 8+
  • Laravel 9

Installation

You can install the package via composer:

composer require expdev07/laravel-logsnag

You can publish the config file with:

php artisan vendor:publish --tag="logsnag-config"

This is the contents of the published config file:



return [

    /*
    |--------------------------------------------------------------------------
    | Logsnag.
    |--------------------------------------------------------------------------
    |
    | Configure the Logsnag options.
    |
    */

    /**
     * The project name.
     */
    'project' => env('LOGSNAG_PROJECT', 'laravel'),

    /**
     * The API token.
     */
    'token' => env('LOGSNAG_TOKEN', ''),

    /**
     * A mapping of icons for logging.
     */
    'icons' => [
        'DEBUG'     => 'ℹ️',
        'INFO'      => 'ℹ️',
        'NOTICE'    => '📌',
        'WARNING'   => '⚠️',
        'ERROR'     => '⚠️',
        'CRITICAL'  => '🔥',
        'ALERT'     => '🔔️',
        'EMERGENCY' => '💀',
    ],

];

Add the Logsnag channel to your logging config:

'channels' => [
    //...
    'logsnag' => [
        'driver'  => 'custom',
        'via'     => ExpDev07\Logsnag\Logger\LogsnagLogger::class,
        'level'   => 'debug',
        'project' => 'my-project',
        'channel' => 'my-channel',
        'notify'  => true,         
    ],
];

Usage

Using logger:

use Illuminate\Support\Facades\Log;
 
Log::channel('logsnag')->emergency('There is an emergency! Please fix ASAP.');

Using facade:

use ExpDev07\Logsnag\Facades\Logsnag;
 
Logsnag::log('my-channel', 
    event: 'New subscriber!', 
    description: 'Someone just subscribed to MySaaS Pro at $9.99', 
    icon: '🤑', 
    notify: true,
);

Using client:

use ExpDev07\Logsnag\Client\LogsnagClient;

app(LogsnagClient::class)->log(new LogsnagRequest(
    project: 'project-name',
    channel: 'channel',
    event: 'Test event',
    description: 'This is a description for test event',
    icon: '😊',
    notify: true,
));

Parameters

  • project: The logsnag project name.
  • channel: The channel to log in. Must be lowercase and hyphenated.
  • event: The event name.
  • description: The event description.
  • icon: Associate the log with an icon (emoji).
  • notify: Whether to send push notifications to devices.

See Logsnag Log route for more information.

Screenshots

A log about a new subscriber in the Logsnag dashboard.

Dashboard Notification 1

A log about an app emergency in the Logsnag dashboard.

Dashboard Notification 2

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

You might also like...
Set multiple alerts from your backend, render them in the frontend with any HTML

Alerts Set multiple alerts from your backend, render them in the frontend with any HTML. alert('This is awesome! 😍', 'success') div class="alert ale

Notifying your users doesn't have to be a lot of work.
Notifying your users doesn't have to be a lot of work.

Messenger for Laravel Goal To provide a drop-in, application-wide alerting functionality to display various types of alerts and notifications to the u

Bugsnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.

The Bugsnag Notifier for Laravel gives you instant notification of errors and exceptions in your Laravel PHP applications. We support both Laravel and Lumen. Learn more about Laravel error reporting from Bugsnag.

Multiple channels of laravel exception notification(DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 laravel 异常通知(钉钉群机器人、飞书群机器人、Server 酱、企业微信群机器人、息知)。
Multiple channels of laravel exception notification(DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 laravel 异常通知(钉钉群机器人、飞书群机器人、Server 酱、企业微信群机器人、息知)。

laravel-exception-notify 简体中文 | ENGLISH Multiple channels of laravel exception notification(DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 laravel

@Authy notification channel for @Laravel, with the ability to send in-app, sms, and call verification tokens.
@Authy notification channel for @Laravel, with the ability to send in-app, sms, and call verification tokens.

Authy Notification Channel for Laravel Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens. Tab

Code execution monitoring for Laravel applications.

Inspector | Code Execution Monitoring Tool Simple code execution monitoring, built for Laravel developers. Requirements Install Configure the Ingestio

 Google Chat - Laravel Notification Channel
Google Chat - Laravel Notification Channel

Google Chat - Laravel Notification Channel This package makes it easy to send notifications using Google Chat , (formerly known as Hangouts Chat) with

Laravel Security Notifications

This package adds security notifications to warn your users when significant security events occur so that they aren't the next victim of an attacker.

Laravel package to launch toast notifications.
Laravel package to launch toast notifications.

Laravel package to launch toast notifications. This package provides assistance when using toast notifications. Using the iziTOAST package, which allo

Releases(v1.0.0)
Owner
Marius
21 years old. Experience in PHP, Laravel, VueJS, Java, Spring, C#, JavaScript, EmberJS, TypeScript, Python, Flask, more.
Marius
Laravel SMS allows you to send SMS from your Laravel application using multiple sms providers, allow to add custom sms provider

Laravel SMS Laravel SMS allows you to send SMS from your Laravel application using multiple sms providers, allow to add custom sms provider Requiremen

Ayman Alaiwah 3 May 7, 2022
:computer: Send notifications to your desktop directly from your PHP script

About JoliNotif JoliNotif is a cross-platform PHP library to display desktop notifications. It works on Linux, Windows or MacOS. Requires PHP >= 7.2 (

JoliCode 1.2k Dec 29, 2022
Push Notifications using Laravel

laravel-push-notification Push Notifications using Laravel PushNotification::send(['deviceToken1', 'deviceToken2',..], 'Notification Message', 'Action

Webelight Solutions 26 Jul 22, 2022
This package makes it easy to send notifications using RocketChat with Laravel 9.0+.

laravel-rocket-chat-notifications Introduction This package makes it easy to send notifications using RocketChat with Laravel 9.0+. Contents Installat

Team Nifty GmbH 25 Dec 1, 2022
Send SMS with easy using BEEM

beem-sms-api Send SMS with easy using BEEM Installation You must be using composer to be able to use this library. If composer 1.x is installed, make

Hosanna Higher Technologies 4 Dec 24, 2021
Server-side library for working with Expo using PHP

expo-server-sdk-php Server-side library for working with Expo using PHP. If you have any problems with the code in this repository, feel free to open

Cedric Twillie 34 Dec 30, 2022
AmaranJS stylish notification for your laravel application.

AmaranJS Laravel 5 Package AmaranJS L5 package is a Laravel wrapper for my jquery plugin AmaranJS.You can create easy and stylish notifications with A

Hakan ERSU 24 Oct 3, 2019
Takes care of Apple push notifications (APNS) in your PHP projects.

Notificato Notificato takes care of push notifications in your PHP projects. Italian: notificato è: participio passato English: notified Why use Notif

Mathijs Kadijk 223 Sep 28, 2022
Notifying your users doesn't have to be a lot of work.

Messenger for Laravel Goal To provide a drop-in, application-wide alerting functionality to display various types of alerts and notifications to the u

GeneaLabs, LLC 138 Jul 22, 2022
Takes care of Apple push notifications (APNS) in your PHP projects.

Notificato Notificato takes care of push notifications in your PHP projects. Italian: notificato è: participio passato English: notified Why use Notif

Mathijs Kadijk 223 Sep 28, 2022