21/10
2017
Provider for Spry
Default Logger Class for Spry, (*1)
Use it through Spry as a Provider., (*2)
This allows you to swap out the Provider later on without having to change your project code., (*3)
Spry::log()->message("My Message"); Spry::log()->warning("Warning"); Spry::log()->error("Error");
OR, (*4)
Use as a standalone Class. (still requires Spry-Core), (*5)
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: ', ] ];