public function setSilentErrorHandler() {

        set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {
            if (0 === error_reporting()) {
                return false;
            }

            if($this->logger != null) {
                // logging all warnings & notices
                $this->getLogger()->log($errstr, Logger::CRITICAL);
            }
        });
    }