Download the PHP package piotrpress/logger without Composer
On this page you can find all versions of the php package piotrpress/logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download piotrpress/logger
More information about piotrpress/logger
Files in piotrpress/logger
Package logger
Short Description This library is compatible with PSR-3 file logger implementation.
License GPL-3.0
Homepage https://github.com/PiotrPress/logger
Informations about the package logger
Logger
This library is compatible with PSR-3 file logger implementation.
Installation
Example
Saves: [error] [Core] Example error
to file: {Y-m-d}.log
and sends to PHP error log.
Logger
HandlerInterface as constructor arguments.
Handlers
- ErrorLogHandler - send logs to PHP error log.
- FileHandler - send logs to file.
NOTE: Both handlers support optional FormatterInterface parameter.
Formatters
- error_log template.
- file template.
NOTE: Both formatters support optional path to template
parameter.
Levels
Logger supports eight log methods to write logs to the eight RFC 5424 levels (debug
, info
, notice
, warning
, error
, critical
, alert
, emergency
) and a ninth method log
, which accepts a log level as the first argument.
Context
All Logger log methods supports optional context
array parameter.
All additional context
array values, evaluated to string, can be used in message
via corresponding keys put between a single opening brace {
and a single closing brace }
according to PSR-3 guidelines.
Context values can be also used in templates
files as regular PHP variables.
Requirements
Supports PHP >= 7.4
version.
License
GPL3.0