FIX #4712 - Exception on writing log
Using array_filter() w/is_scalar() to fix #4712

This doesn't change the $message variable which prevented additional exceptions of being logged
Merge pull request #338 from dm/3.3/develop

3.3/develop (refs #4712)