phpgenesis / logger
Logger for PHPGenesis
Requires
- php: ^8.3
- illuminate/log: ^10|^11
- monolog/monolog: ^3.6
- phpgenesis/common: v0.2.41
- dev-main
- v0.2.41
- v0.2.40
- v0.2.39
- v0.2.38
- v0.2.37
- v0.2.36
- v0.2.35
- v0.2.34
- v0.2.33
- v0.2.32
- v0.2.31
- v0.2.30
- v0.2.29
- v0.2.28
- v0.2.27
- v0.2.26
- v0.2.25
- v0.2.24
- v0.2.23
- v0.2.22
- v0.2.21
- v0.2.20
- v0.2.19
- v0.2.18
- v0.2.17
- v0.2.16
- v0.2.15
- v0.2.14
- v0.2.13
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.2
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2024-11-07 01:17:49 UTC
README
The PHPGenesis Logger is an abstraction layer on top of the Laravel Log Facade and Monolog.
Installation
To install the Logger package, you can use Composer:
composer require phpgenesis/logger
Usage
To log a message, use the PHPGenesis\Logger\Logger
class.
use PHPGenesis\Logger\Logger;
The following methods are available for you to use via Logger
:
$message = 'This is an example logger message'; Logger::debug($message); Logger::info($message); Logger::notice($message); Logger::warning($message); Logger::error($message); Logger::critical($message); Logger::alert($message); Logger::emergency($message);
All methods all accept an additional optional parameter for context data. The context data must be an array and defaults to an empty array if not supplied
The Logger
class will determine if the Laravel Log Facade is available and use it, otherwise it will use Monolog. If Laravel is available, the Logger
class will use
the Laravel configuration settings for logging. Otherwise, Logger
will use the settings configured in your phpgenesis.json
file.