pgtruesdell / laravel-logsnag
Logsnag's realtime monitoring + your Laravel project = đ
1.3
2025-01-23 22:56 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-01-23 22:58:37 UTC
README
This package allows you to easily integrate Logsnag into your Laravel application.
Installation
You can install the package via composer:
composer require pgtruesdell/laravel-logsnag
You can publish the config file with:
php artisan vendor:publish --tag="laravel-logsnag-config"
This is the contents of the published config file:
return [ /** * The project name. */ 'project' => env('LOGSNAG_PROJECT', 'my-laravel-app'), /** * The default channel name for the monolog driver. */ 'channel' => env('LOGSNAG_CHANNEL', 'app-events'), /** * Your logsnag API token. */ 'token' => env('LOGSNAG_TOKEN', ''), /** * A mapping of icons for logging. */ 'icons' => [ 'DEBUG' => 'âšī¸', 'INFO' => 'âšī¸', 'NOTICE' => 'đ', 'WARNING' => 'â ī¸', 'ERROR' => 'â ī¸', 'CRITICAL' => 'đĨ', 'ALERT' => 'đī¸', 'EMERGENCY' => 'đ', ], ];
Usage
Using the built-in helper function:
logsnag( 'app', 'Artist Created', 'Artist id 589 created by user 2', 'đ¨', );
Using the facade:
use PGT\Logsnag\Facades\Logsnag; Logsnag::log( channel: 'app', event: 'Artist Created', description: 'Artist id 589 created by user 2', icon: 'đ¨', notify: false );
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.