Download the PHP package mmdm/sim-logger without Composer
On this page you can find all versions of the php package mmdm/sim-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sim-logger
Simplicity Logger
A library to log your activities
Install
composer
Or you can simply download zip file from github and extract it, then put file to your project library and use it like other libraries.
Just add line below to autoload files:
and you are good to go.
How to use
Or instantiate Logger
with other optional constructor parameters
Description
$handler
is a type of IHandler
and an IHandler
is an interface
to extend logger for other kind of handlers and not just file handling.
Also you can set handler after initializing the logger with
method handler(IHandler $handler)
.
To extend IHandler
you must implement these functions
$format
is to format message that need to be written.
Default value is {level}: {date} - {message}
$format_date
is to format date of log. Default value is Y-m-d H:i:s
.
Available functions
There are many functions to log your message. The order of importance of them are:
-
EMERGENCY - highest level priority
-
ALERT
-
CRITICAL
-
ERROR
-
WARNING
-
NOTICE
-
INFO
- DEBUG - lowest level priority
If you have additional data to log, then you should use
extraParameters($parameter)
method and modify logger format to
show your parameter in log message with format($format)
method.
If you need to change date format, then you can use dateFormat($format)
method
If you want have a better experience with date, you should enter
your timezone through setTimezone($timezone)
method. Default timezone
is environment default timezone.
The timezone will show with date for more information.
exp. 2020-07-25 09:46:19 (America/New_York)
License
Under MIT license.
All versions of sim-logger with dependencies
ext-json Version *