How to dump arrays to different log files in Symfony?

January 04 1 Comment Category: Symfony PHP

Logging on a separate log file in Symfony:

$logPath = sfConfig::get('sf_log_dir') . '/debug_chat.log';
$logger = new sfFileLogger(new sfEventDispatcher(), array('file' => $logPath));
$logger->info("Info");

Dumping the array:

$logger->info(var_export($arrayVar, true));

One Response

Write a comment

Write a Comment

Commenter Gravatar