PHP code example of bluebik / logger

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

    

bluebik / logger example snippets


use Bluebik\Logger\LoggerFactory;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    protected $logger;

    public function __construct()
    {
        $this->logger = LoggerFactory::create('action');
    }

    public function index()
    {
        $this->logger->action(__METHOD__, "start");
        ...
    }
}

protected $commands = [
    \Bluebik\Logger\Commands\LogBackup::class,
    ...
];


protected function schedule(Schedule $schedule) {
    $schedule->command('log:backup')->daily();
    ...
}

protected $middleware = [
    \Bluebik\Logger\Middleware\AccessLogMiddleware::class,
    ...
];

use Bluebik\Logger\Traits\CommandLogger;

class CommandClass extends Command {
    use CommandLogger;

    public function handle()
    {
        $this->logger->action(__METHOD__, "start");
        ...
    }
}