Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-14718

Improve debug output from default exception handler to support debug by ip

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 4.1.1, 4.2.0alpha1
    • 4.1.0
    • Misc
    • None

    Description

      To:
      1. support debug by ip settings
      2. also give debug ouput in cli
      3. improve logging to error.log to include file and line number

      Index: lib/ezutils/classes/ezexecution.php
      ===================================================================
      --- lib/ezutils/classes/ezexecution.php	(revision 23336)
      +++ lib/ezutils/classes/ezexecution.php	(working copy)
      @@ -205,21 +205,25 @@
                   header( 'HTTP/1.x 500 Internal Server Error' );
                   header( 'Content-Type: text/html' );
       
      -            echo "An unexpected error has occurred. Please contact the webmaster.<br/>";
      +            echo "An unexpected error has occurred. Please contact the webmaster.<br />";
       
      -            $ini = eZINI::instance( 'site.ini' );
      -            if( $ini->variable( 'DebugSettings', 'DebugOutput' ) == 'enabled' )
      +            if( eZDebug::isDebugEnabled() )
                   {
      -                echo $e->getMessage() , ' in ', $e->getFile(), ' on line ', $e->getLine();
      +                echo $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine();
                   }
               }
               else
               {
                   $cli = eZCLI::instance();
                   $cli->error( "An unexpected error has occurred. Please contact the webmaster.");
      +
      +            if( eZDebug::isDebugEnabled() )
      +            {
      +                $cli->error( $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine() );
      +            }
               }
       
      -        eZLog::write( 'Unexpected error, the message was : ' . $e->getMessage(), 'error.log' );
      +        eZLog::write( 'Unexpected error, the message was : ' . $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine(), 'error.log' );
       
               eZExecution::cleanup();
               eZExecution::setCleanExit();
      
      

      Attachments

        Activity

          People

            andre1 andre1
            andre1 andre1
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: