I'm trying to see debug statements generated by the custom page controller associated with a Visualforce page, but am having no luck.

I see no logs to track. I'm looking for logs in the Dev Console and Setup>Monitoring>Debug Logs.

What am I doing wrong?

Here's the VF page:

<apex:page controller="TestVFcontroller" showHeader="false" sidebar="false">   
    <apex:commandButton value="do Something" action="{!doSomething}"/> 

Here's the controller:

public class TestVFcontroller {
    public void doSomething() {
        system.debug('running... '+datetime.now());

Finally, I've attached my log level settings in case that's related... enter image description here Thanks for helping with this stumper...

  • Have you added your user to the Monitoring Users section? – Boris Bachovski Feb 24 '15 at 0:28
  • yes, I've tried that. no difference. thanks though – sberley Feb 24 '15 at 0:35
  • 1
    Are you accessing this page through sites as a anonymous user? – singularity Feb 24 '15 at 0:59
  • Yes, I am. That's how it'll be used in the wild. It's a listener page for inbound transactions. Am I missing some settings? (What's now called by a button will actually be called on page load.) – sberley Feb 24 '15 at 1:05
  • the user to monitor is not 'you' but the sites guest user that is set up when the site is defined - this drove me nuts years ago until I realized this – cropredy Feb 24 '15 at 1:14

Getting the debug log for a SFDC Sites user transaction is done by monitoring the sites guest user. This is easy to miss because you are testing the interface logged in as you on every other SFDC page, including the developer console.

Similar situations arise when testing inbound salesforce-to-salesforce transactions which run as 'Connection User'

| improve this answer | |
  • In the add user to monitor enter guest and press enter. It should show you list of sites guest users and you pick one of them. – singularity Feb 24 '15 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.