PHP code example of schaefersoft / laravel-seq

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

    

schaefersoft / laravel-seq example snippets


'properties' => [
    'Application' => env('APP_NAME', 'Laravel'),
    'Environment' => env('APP_ENV', 'production'),
    'Server' => gethostname(),
],

'channels' => [
    'audit' => [
        'driver' => 'seq',
        'url' => env('SEQ_AUDIT_URL'),
        'api_key' => env('SEQ_AUDIT_API_KEY'),
        'level' => 'info',
        'properties' => ['Application' => 'Billing'],
        'processors' => [
            Monolog\Processor\WebProcessor::class,
            ['processor' => Monolog\Processor\UidProcessor::class, 'with' => ['length' => 12]],
        ],
    ],
],

Log::info('Order {order_id} placed by {email}', ['order_id' => 1042, 'email' => '[email protected]']);

Log::error('Payment failed for order {order_id}', ['order_id' => 1042, 'exception' => $exception]);

Context::add('request_id', (string) Str::uuid());

use SchaeferSoft\Seq\Facades\Seq;

Seq::flush();

use Illuminate\Http\Client\Request;
use SchaeferSoft\Seq\Facades\Seq;

$http = Seq::fake();

Log::channel('seq')->info('Order {order_id} placed', ['order_id' => 1042]);
Seq::flush();

$http->assertSent(fn (Request $request) => str_contains($request->body(), '"order_id":1042'));
bash
php artisan vendor:publish --tag=seq-config
xml
<env name="SEQ_ENABLED" value="false"/>