Development

#2864 ([PATCH] Symfony log does not show exception description under certain conditions)

You must first sign up to be able to contribute.

Ticket #2864 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Symfony log does not show exception description under certain conditions

Reported by: StephenD Assigned to: fabien
Priority: minor Milestone: 1.0.11
Component: controller Version:
Keywords: Cc:
Qualification: Accepted

Description

Steps to reproduce

When an exception is raised in the code, for example:

throw new Exception('bad data');

then in the symfony log (myapp_prod.log), it only shows:

Jan 14 12:07:52 symfony [err] {sfException}

without the exception description (in this case 'bad data').


The fix


If I change /symfony/controller/sfFrontWebController.class.php line 69,

from (original line):

$sfException = new sfException();

to (proposed line):

$sfException = new sfException($e->getMessage().' in '.$e->getFile().' line '.$e->getLine());

then the log file will show error description along with filename and line number.

Jan 14 12:07:52 symfony [err] {sfException} bad data in test.php line 10



Attached is the modified version of the file.

Thanks

Attachments

sfFrontWebController.class.php (2.0 kB) - added by StephenD on 01/31/08 06:11:49.

Change History

01/31/08 06:11:49 changed by StephenD

  • attachment sfFrontWebController.class.php added.

04/05/08 20:10:57 changed by FabianLange

  • status changed from new to closed.
  • resolution set to fixed.

(In [8319]) added some more information to non symfony exceptions. closes #2864

04/05/08 20:13:59 changed by FabianLange

  • qualification changed from Unreviewed to Accepted.
  • milestone set to 1.0.11.

this was tackled already in #2064 and closes in 1.0.11. I added the proposed information now. Its working okay in symfony 1.1

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.