A simple PHP Logger
- PHP >= 5.3
- Composer
- Add Composer support done
- Comply with PSR-3
- Copy XLog folder to a location where you can reference it.
- Add reference in your application e.g.
PHP include_once 'XLog\Logger.php'
- Edit log file location in config
include_once 'XLog\Logger.php';
use XLog\Logger;
$logger = new Logger();
$logger->log('trace', 'Trace to log');
The config file must be named XLog.config
. Within the config file you can set options for the log file and console output.
location
The path and filename of the log file.minLevel
The minimum log level allowed. E.g. if set towarn
onlywarn
,error
, andfatal
will be output.enable
Should be set to'true'
/'false'
. Determines whether the log file should be output to.
minLevel
The minimum log level allowed. E.g. if set towarn
onlywarn
,error
, andfatal
will be output.enable
Should be set to'true'
/'false'
. Determines whether the console should be output to.
Available levels are:
- fatal
- error
- warn
- info
- debug
- trace