Fix too verbose error logging on default production environment

issue was present on PHP < 5.4
Merge pull request #2545 from vlakoff/develop-3

Fix too verbose error logging on default production environment