+ Start a Discussion
AstrocloudAstrocloud 

debug messages in visual force pages?

Hi,  thanks for reading...

 

I'm having trouble finding where some of my code is going wrong.

 

The code is uploaded from the IDE just fine but when executed via a command button:

 

 

 

apex:commandButton action="{!shop}" value="Buy"

 

 The code leads to a "is down for maintenance ".

 

When I was an undergrad writing code; I used to be able to write to stdout... to see how far my code was going before it went awry...

 

Is there a way to do this in Apex for visualforce pages?

 

Thanks,

 

Eric

Best Answer chosen by Admin (Salesforce Developers) 
_Prasu__Prasu_

you can use Message class for printing the debug log in Page.

 

http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_message.htm

All Answers

_Prasu__Prasu_

you can use Message class for printing the debug log in Page.

 

http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_message.htm

This was selected as the best answer
RyanGuestRyanGuest

You can also use System.debug() from Apex and then look in the debug logs (in Setup -> Monitoring -> Debug logs)

Paul DevenportPaul Devenport
I don't see any logs for my browser's visualforce session in (Setup -> Monitoring -> Debug logs).
How do I enable it?
Nikhil Shringarpure 17Nikhil Shringarpure 17
Paul you need to go to Debug in the quick find search(which is under monitoring) then click on new fill in the details, select the user that you want the debug log created for. Make sure your start date and end date does not have difference of more than 24 hours thats how long will the log keep generating for the actions that you perform and minimum can be half hour.

If you do not have any debug levels set, please set them up before you create a new trace for Debug.

Logs are generated at the time of execution.

Nikhil Shringarpure