Reputation: 95
I am trying to read error.log file.
function readerrorlog(){
$file = new File('/tmp/error/error.log');
$errorfile = $file->read(true, 'r');
}
$file returns array File Object
(
[Folder] => Folder Object
(
[path] =>
[sort] =>
[mode] => 493
[_messages:protected] => Array
(
)
[_errors:protected] => Array
(
)
[_directories:protected] =>
[_files:protected] =>
)
[name] => error.log
[info] => Array
(
)
[handle] =>
[lock] =>
[path] => /error.log
)
and $errorfile
is returning nothing
Upvotes: 0
Views: 4712
Reputation: 5769
By default error logs in CakePHP 3 are located in the logs folder.
YOURAPP
/logs
/plugins
/src
/...
Path to the logs directory LOGS.
//$file = new File(LOGS.'error.log');
function readerrorlog(){
$file = new File(LOGS.'error.log');
$errorfile = $file->read();
return $errorfile;
}
Upvotes: 2