Reputation: 15
Please help me with my problem. I am new with symfony 2 and i can't resolve my problem alone. I wan't to see my variable value in symfony 2 console and i read that it can be resolved with logger but when i use logger i see the type of my variable but i wan't to see a value of my variable. Have can i see it ???
public function helloAction($name)
{
$a = array('b' => 'ffsddsfs');
$logger = $this->get('logger')->info($a);
return array('name' => $name, 'a' => $a);
}
result.
INFO - Array
Upvotes: 1
Views: 2103
Reputation: 2259
Please try it with this
$logger = $this->get('logger')->info(var_export($a, true));
This makes a string from your array and then the logger should be able to print the variable!
Upvotes: 2