Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 973893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:20:53+00:00 2026-05-16T03:20:53+00:00

Currently I am using a basic error controller which looks like this: class ErrorController

  • 0

Currently I am using a basic error controller which looks like this:

class ErrorController extends My_MyController
{

    public function errorAction()
    {
        $errors = $this->_getParam('error_handler');

        switch ($errors->type) {
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
                // 404 error -- controller or action not found
                $this->getResponse()
                     ->setRawHeader('HTTP/1.1 404 Not Found');

                $this->view->headTitle('HTTP/1.1 404 Not Found');
                $this->view->message = 'HTTP/1.1 404 Not Found';

                break;
            default:
                // application error; display error page, but don't change
                // status code

                // Log the exception:
                $exception = $errors->exception;
                $log = new Zend_Log(
                    new Zend_Log_Writer_Stream(
                        BASE_PATH . '/logs/applicationException.log'
                    )
                );
                $log->debug($exception->getMessage() . "\n" .
                            $exception->getTraceAsString());

                $this->view->headTitle('HTTP/1.1 404 Not Found');
                $this->view->message = 'Application error';

                break;
        }

        $this->view->exception = $errors->exception;
    }
}

This, however, only catches and logs application exceptions. It won’t log any warnings, notices and fatal errors.

I would like to log those as well. Is there a recommended way to do it in ErrorController? Or should it be done outside of the ErrorController in index.php (since Zend Framework ErrorHandler will only handle no route, missing application/action exceptions and exceptions in action controllers)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:20:54+00:00Added an answer on May 16, 2026 at 3:20 am

    Notices and warnings aren’t (or shouldn’t) be application fatal. Fatal errors do what they say on the tin and sometimes can’t be caught. But, if you really need to, perhaps look into:

    http://php.net/manual/en/function.set-error-handler.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 499k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could use the MySQL function LEFT to get the… May 16, 2026 at 12:33 pm
  • Editorial Team
    Editorial Team added an answer I'm not 100% sure I understand your question. It looks… May 16, 2026 at 12:33 pm
  • Editorial Team
    Editorial Team added an answer They are, just override like this: @Override public boolean onCreateOptionsMenu(Menu… May 16, 2026 at 12:33 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm currently using the following jQuery plugin: jQuery OEmbed. This plugin works great in
I have a few before filters which I am using to control access to
Lets say i'm listing musical artists, each artist has basic information like Name, Age
This question has been brought up many times, but I'd like to ask it
I have a basic app using the ASP.NET membership provider. By default, you can
Currently, when I contribute property pages to Eclipse using the org.eclipse.ui.propertyPages extension point, the
We have an existing website which currently uses v2 of the google maps api
I would like to connect to a DB2 database, specifically an iSeries version, using
Woo. My first question. I have a feeling I'm overlooking something pretty basic in
I am currently working on a little application: The structure follows in some way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.