Adding custom logger : apache
function logger($message, $data)
{
$path = '/path/to/your/custom_file.log';
if (!file_exists( $path ))
{
touch($path);
}
error_log( print_r($message, TRUE) . " : ".
print_r($data, TRUE) , 3, $path);
return true;
}
You can use the function as below
logger(array('test'=> 'logger'));
logger("test", array('1'=> 'test1', '2'=> 'test2'));
and to see the debugging messages type the following in terminal
tail -f /path/to/your/custom_file.log
Written by Madhu GB
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#