PHP code example of edi-prasetyo / error-log-capture

1. Go to this page and download the library: Download edi-prasetyo/error-log-capture 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/ */

    

edi-prasetyo / error-log-capture example snippets


config/error-log-capture.php

return [
    'enabled' => true,

    'ignore' => [
        \Illuminate\Validation\ValidationException::class,
        \Symfony\Component\HttpKernel\Exception\HttpException::class,
    ],

    'trace_limit' => 10,
];

use EdiPrasetyo\ErrorLogCapture\Facades\ErrorLog;

try {
    // kode berpotensi error
} catch (\Throwable $e) {
    ErrorLog::capture($e);
}


use EdiPrasetyo\ErrorLogCapture\Models\ErrorLogModel;

$errors = ErrorLogModel::all();
return $errors

bash
php artisan migrate
bash
php artisan vendor:publish --tag=error-log-capture-config
html
php artisan vendor:publish --tag=error-log-capture-views