I am having this code to execute in a local host and I am using wamp server for php5.3 x64 bit and I am unable to execute this code and I am very new to php.
Is there any code changes or any additions to this code?
My file name is monolog_usage_1.php
and I copied monolog file in src
of https://github.com/Seldaek/monolog downloaded one to the same directory.
use \Monolog\Logger;
use \Monolog\Handler\StreamHandler;
include '\Monolog\Logger.php';
// create a log channel
$log = new Logger('name');
$log->pushHandler(new StreamHandler('D:\addlog.log', Logger::WARNING));
// add records to the log
What I pass as the name To the logger(‘name’), is it any method name like ERROR, ALERT…
Thanks in advance..
The error is explicit
Class 'Monolog\Logger' not found in C:\wamp\www\test\monolog\monolog usage.phpWhen using Monolog you need to include all need class with full path