PHP code example of ggedde / spry-log

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

    

ggedde / spry-log example snippets


Spry::log()->message("My Message");
Spry::log()->warning("Warning");
Spry::log()->error("Error");

 SpryLogger::message("My Message");

$config->loggerProvider = 'Spry\\SpryProvider\\SpryLogger';
$config->logger [
	'format' = '%date_time% %ip% %path% - %msg%',
    'php_format' => "%date_time% %errstr% %errfile% [Line: %errline%]\n%backtrace%",
	'php_file' => __DIR__.'/logs/php.log',
	'api_file' => __DIR__.'/logs/api.log',
	'max_lines' => 5000,
	'archive' => false,
	'prefix' => [
		'message' => 'Spry: ',
		'warning' => 'Spry Warning: ',
		'error' => 'Spry ERROR: ',
		'stop' => 'Spry STOPPED: ',
		'response' => 'Spry Response: ',
		'request' => 'Spry Request: ',
	]
];