8

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.

  • 3
    is your apex logging at INFO or higher? -- then the debug line won't appear. – cropredy Jul 22 '14 at 23:05
8

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!');
  • 3
    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 '14 at 0:09
  • 2
    And +1 for catching the Ender's game reference. :) – Joshua Dance Sep 26 '14 at 16:53
  • 1
    @JoshuaDance I always thought Bean was a more interesting character. :) – Daniel Ballinger Sep 27 '14 at 8:41

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.