Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to manage error log in cakephp in 2.4.1 version?
If you want to create error log file in your CakePHP web application so firstly you have to search
location to error.log file in your application.
you can see location of error.log file below line
/app/tmp/logs/error.log
In this file you can create error file by using keyword CakeLog::write() method.
syntax of CakeLog::write() method:
CakeLog::write('error', 'massage');
you can see below example
<?php
try {
//code will be here
} catch(Exception $e) {
CakeLog::write('error', $e->getMessage());
}
?>
You can see your log under '/app/tmp/logs/ directory
0 Comment(s)