Why log status is success and not failed?

Resolved in Summer '16 - View Visualforce Controller Exceptions in Debug Logs


I raised this with Salesforce support in Case 13205328.

They came back with the known issue Exception Details not logged in Debug Logs if happens in Constructor context.

This seemed to agree with my quick tests. If the exception occured in the constructor the Status showed success. The same exception from a property in the controller showed as Status "Divide by 0".


Visualforce always shows successful during logging. I suspect that's because the underlying Visualforce layer catches the exception and renders it into something useful (if not a bit obnoxious, since it also wipes out the view state for the user). This behavior is not new to Winter '16, but has been around for quite a while (as far back as I can recall).

In fact, I think I plan on bringing this up as a bug with R & D, if I can get it that far, because it really does make the Status field less useful than it should be, and makes it especially hard to track down failures when you're trying to debug remotely and you've got hundreds of logs from users that all show successful when some of them really are not (and are the only ones you happen to care about).

Just a couple of weeks ago I had an error on a Visualforce page that was very chattery (about three or four logs per single transaction to work around limitations), and so I had to dig through about 2 or three pages of logs by opening them one at a time until I found the one that I wanted. It's a very terrible experience and can make tracking down errors a lot more challenging than it should be.

Tags:

Exception

Apex