PHP code example of csun-metalab / laravel-multiple-logs

1. Go to this page and download the library: Download csun-metalab/laravel-multiple-logs 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/ */

    

csun-metalab / laravel-multiple-logs example snippets


php artisan vendor:publish


namespace App\Logging;
use CSUNMetaLab\MultipleLogs\Loggers\Logger;

class PurchaseLogger extends Logger
{
	/**
	 * Constructs a new PurchaseLogger object.
	 *
	 * @param string $path The path to the log file
	 * @param string $logLevel Optional parameter to specify minimum log level
	 */
	public function __construct($path, $logLevel="debug") {
		parent::__construct($path, 'purchase', $logLevel);
	}
}


use App\Logging\PurchaseLogger;
$pLogger = new PurchaseLogger(storage_path('logs/purchases.log'));

$pLogger->info("Successfully made a purchase");