Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have an action method in a VisualForce page.

<apex:page standardController="Query__c"
    extensions="Builder"
    tabStyle="links__tab"
    title="Query Edit"
    action="{!giveMeHi}"
    id="Builder">

In the Builder extension I have the method:

public void giveMeHi(){
            System.debug('dragon army');
        }

I can't tell if that method is getting called since my system.debug calls are not appearing in the logs. I have used the Developer Console, I have downloaded the logs directly.

share|improve this question
3  
is your apex logging at INFO or higher? -- then the debug line won't appear. –  crop1645 Jul 22 at 23:05

1 Answer 1

up vote 6 down vote accepted

As @crop1645 commented, if the Apex Code logging level is set to high on the general trace settings or on the Builder class the log message won't appear. By default System.debug will log at the Debug level.

In the Developer Console, check your Apex Code Log Levels are Debug or lower. Check Both the General Trace Settings for User and for any Class specific traces for Builder.

enter image description here

enter image description here

You could try using a higher logging level:

System.debug(LoggingLevel.Error, 'Rabbit Army');

Or really prove it is being called by making a failing assertion:

System.assert(false, 'Bean!');
share|improve this answer
2  
Logging level error is the only level I use when I absolutely need to see a debug entry. The assertion trick is also incredibly handy. –  sfdcfox Jul 23 at 0:09
    
+1 for the assertion trick. –  Joshua Dance Jul 28 at 20:24
1  
And +1 for catching the Ender's game reference. :) –  Joshua Dance Sep 26 at 16:53
    
@JoshuaDance I always thought Bean was a more interesting character. :) –  Daniel Ballinger Sep 27 at 8:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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