fastik1 / logger
1.0.0
2023-05-13 11:58 UTC
Requires
- php: >=8.0
Requires (Dev)
- ext-json: *
README
Install
- composer require fastik1/logger
Usage
<?php require_once 'vendor/autoload.php'; use Fastik1\Logger\Logger; Logger::setPath('logs'); // Default value Logger::setExtension('.log'); // Default value Logger::setDateFormat('d.m.Y H:i:s'); // Default value Logger::add('errors', 'Fatal error...', ['info' => 'your info', 'data' => 'your data']);
Result: logs/errors.log
[01.01.2023 00:00:00] Fatal error... | Context: {"info":"your info","data":"your data"}