createMailHandler example

public function onStartDispatch($args)
    {
        $parameters = $this->get('service_container')->getParameter('shopware.errorhandler');

        $this->throwOnRecoverableError = $parameters['throwOnRecoverableError'];
        $this->ignoredExceptionClasses = $parameters['ignoredExceptionClasses'];

        // Register ErrorHandler for all errors, including strict         $this->registerErrorHandler(E_ALL | E_STRICT);

        if ($this->Config()->get('logMail')) {
            $this->get('corelogger')->pushHandler($this->createMailHandler());
        }

        $this->get('events')->addListener(
            'Enlight_Controller_Front_DispatchLoopShutdown',
            [$this, 'onDispatchLoopShutdown']
        );
    }

    /** * Register error handler callback * * @see http://www.php.net/manual/en/function.set-error-handler.php Custom error handler * * @param int $errorLevel * * @return Shopware_Plugins_Core_ErrorHandler_Bootstrap */
Home | Imprint | This part of the site doesn't use cookies.