mehmetnky / logger
A light-weight logger library
dev-main
2023-02-27 23:53 UTC
Requires
- php: >=8.1
- myclabs/php-enum: ^1.8
- psr/log: ^3.0
This package is not auto-updated.
Last update: 2024-12-18 06:51:30 UTC
README
A lightweight PSR-3 logger
Installation
$ composer require mehmetnky/logger
Usage
use Mehmetnky\Logger\Logger; // Creates an "app.log" file in root folder. $logger = new Logger(); // Or you can specify a path for your log file. $logger = new Logger('custom/path/to/my.log'); $logger->emergency('Log message', ['additional', 'information']); $logger->alert('Log message', ['additional', 'information']); $logger->critical('Log message', ['additional', 'information']); $logger->error('Log message', ['additional', 'information']); $logger->warning('Log message', ['additional', 'information']); $logger->notice('Log message', ['additional', 'information']); $logger->info('Log message', ['additional', 'information']); $logger->debug('Log message', ['additional', 'information']); /* A Sample Log [2023-02-27 11:06:34] DEBUG: Log message MoreInfo: 0: additional 1: information */
License
The MIT License (MIT). Please see License File for more information.