1. Go to this page and download the library: Download digitaldev-lx/log-hole 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/ */
use DigitalDevLx\LogHole\Middlewares\LogHoleMiddleware;
protected $middlewareGroups = [
'web' => [
// outros middlewares
\DigitalDevLx\LogHole\Middleware\LogHoleMiddleware::class,
],
];
use DigitalDevLx\LogHole\Middlewares\LogHoleMiddleware;
->withMiddleware(function (Middleware $middleware) {
$middleware->append(LogHoleMiddleware::class);
})
use DigitalDevLx\LogHole\Attributes\Loggable;
class ExampleService
{
#[Loggable(message: 'Executed important method', level: 'info')]
public function importantMethod()
{
// Lógica
}
}
use Illuminate\Support\Facades\Log;
Log::info('This is a log message for LogHole!');
Log::error('An error occurred in LogHole');