webfan3 / php-error-logging
ErrorHandling,logging,whoops-implemntation
Installs: 177
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:frdl-extension
Requires
- php: >=5.3.6
- filp/whoops: ~2.7.3
- franzl/whoops-middleware: 1.2.0
- frdl/frdlweb-composer-installers: *
- frdl/webfan: *
- markrogoyski/simplelog-php: 0.4.0
- psr/log: *
- wshafer/psr11-monolog: 3.0.0
Suggests
- frdl/install-setup-wizard: Installer/Setup-Wizard to create your Frdlweb-Workspace (Development-Server).
- frdl/project: Kickstarter boilerplate to be used by `composer create-project` command. Demo/Test Application.
README
ErrorHandling
Installation
$ composer install webfan3/php-error-logging
Usage
You can use the dependent libraries (standalone) or configure the frdlweb Container
deprecated Usage
\Webfan\Support\PhpLogs old class
new \Webfan\Support\PhpLogs([ 'logs.debug' => false, 'logs.dir' => ((class_exists(\webfan\hps\patch\Fs::class)) ? \webfan\hps\patch\Fs::getRootDir() : getcwd()) .\DIRECTORY_SEPARATOR.'logs'.\DIRECTORY_SEPARATOR.'frdl'.\DIRECTORY_SEPARATOR, 'logs.prune_size.trigger' => 999999, 'logs.prune_size.size' => 32000, 'logs.autoprune' => true, 'logs.file.errors' => 'php_error_log', 'logs.file.memory' => 'php_memory_log', 'logs.error_level' => 1, 'logs.log_level' => 0, 'logs.error_reporting' => \E_ALL, 'logs.display_errors' => 0, ], true, function($e, $message, $level){ $status = 500; $headers = ['X-Frdl-Response' => 'ServerErrorException']; $body = '<error>'.$e->getMessage().'<br />'.$message.'</error>'; $protocol = '2.0'; // $response = new \GuzzleHttp\Psr7\Response($status, $headers, $body, $protocol); // if(function_exists('\Http\Response\send'))\Http\Response\send($response); die($body); });