Download the PHP package mattmezza/logger without Composer
On this page you can find all versions of the php package mattmezza/logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mattmezza/logger
More information about mattmezza/logger
Files in mattmezza/logger
Download mattmezza/logger
More information about mattmezza/logger
Files in mattmezza/logger
Vendor mattmezza
Package logger
Short Description Lightweight package for logging purposes.
License MIT
Package logger
Short Description Lightweight package for logging purposes.
License MIT
Please rate this library. Is it a good library?
Informations about the package logger
php-logger
This package is a small utility for logging purposes. It allows you to quickly set up a logging system.
Usage
The main component to use is LevelLogger
. Just create a new instance and start logging.
There are 3
levels namely info|debug|error
that come handy when switching environment development|staging|production
.
The package comes with 3
logging strategies namely:
STDOUT
(default): it justecho
the message (together with a timestamp and the log level)SYSLOG
: calls thesyslog(...)
function and logs the message (using the syslog format) to the system logFILE
: appends the log message (together with the timestamp and log level) to a file that you specify
How do you specify the parameters?
The package reads from ENV
variables. The following variables are used:
LOG_LEVEL
: can be eitherINFO|DEBUG|ERROR
and defaults toERROR
to be the least verbose. When the log level isERROR
all theinfo
anddebug
messages will not be logged. When the log level is set toDEBUG
, all theinfo
messages will not be logged. When set toINFO
instead, all of the messages will be logged;LOG_STRATEGY
: can be eitherSTDOUT|SYSLOG|FILE
and defaults toSYSLOG
. It sets the strategy. When theFILE
strategy is chosen, please specify the file path by using the next described variable;LOG_FILE_PATH
: must be a writable file path. It defaults to/var/log/logger.log
;
Development
You can add new loggers by implementing the Logger
interface.
Further development
- [ ] Would be nice to add a file rotate feature when logging to file.
All versions of logger with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.0
The package mattmezza/logger contains the following files
Loading the files please wait ....