PHP code example of taitai42 / stklog-laravel

1. Go to this page and download the library: Download taitai42/stklog-laravel 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/ */

    

taitai42 / stklog-laravel example snippets


'providers' => [
    ...,
    \taitai42\Stklog\StklogServiceProvider::class,
  ],


protected $middleware = [
 ...,
 
 taitai42\Stklog\Middleware\StklogMiddleware::class,
];

// use taitai42\Stklog\Model\StackRepository;

StackRepository::stack('incoming request', null, $request->headers->all());
Log::info("parsing request ...");
 



use Monolog\Logger;
use taitai42\Stklog\Handler\StklogHttpHandler;

// create a log channel
$log = new Logger('name');
$log->pushHandler(new StklogHttpHandler('your-project-key', Logger::WARNING));

// add records to the log
$log->warning('Foo');
$log->error('Bar');
bash
php artisan vendor:publish