[eluser]dlm1897[/eluser]
Hi all, I am attempting to do a var_dump from a controller to my log file and I'm left with an empty line.
Here's the code within my controller:
Code:
$checked = 'test error';
log_message('error', var_dump($checked));
In my log file, I get:
Quote:ERROR - 2014-06-23 12:30:34 -->
I am able to get the log file result of:
Code:
$checked = 'test error';
log_message('error', $checked);
, so it must be an issue with var_dump()?
Any ideas? Thanks for the help.
ANSWER:
I had to use output buffering since var_dump() only outputs and does not return. The following works:
Code:
ob_start();
var_dump($checked);
$result = ob_get_contents(); //or ob_get_clean()
log_message('error', $result);