Moved logging to a HHVM and PHP compatible mode

Fixes #1134