1. Go to this page and download the library: Download pgtruesdell/laravel-logsnag library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pgtruesdell / laravel-logsnag example snippets
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' => '💀',
],
];
logsnag(
'app',
'Artist Created',
'Artist id 589 created by user 2',
'🎨',
);
use PGT\Logsnag\Facades\Logsnag;
Logsnag::log(
channel: 'app',
event: 'Artist Created',
description: 'Artist id 589 created by user 2',
icon: '🎨',
notify: false
);