You need to sign in to do that
Don't have an account?
Ignacio de la torre
System.debug() not loggin anything after succesfull external call is made
Hi !
I'm having trouble debuggin a method I just wrote:
I'm executing this in the Developer Console in a Anonymous Window and the operation is Succesfull but no debug log is shown when I check the "Debug only" checkbox in the Logs Tab.
As you can see I want to know what the client is to see if it's returning the expected ones.
Debug logs are set to SFDC_DevConsole so that's ok and if I only write System.debug('hello') for example and only execute this in the Anonymous window it does log correctly in the Log Tab, so I can't figure out what the problem might be. Please help
I'm having trouble debuggin a method I just wrote:
public class getClients { public List<Object> callOut(String clientId){ Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('https://api.disputeprocess.com/api/v1/clients?'); request.setMethod('GET'); request.setHeader('Content-Type', 'application/json;charset=UTF-8'); request.setHeader('api_key', 'xxxxx'); request.setHeader('api_token', 'xxxxx'); HttpResponse response = http.send(request); // If the request is successful, parse the JSON response. if (response.getStatusCode() == 200) { // Deserialize the JSON string into collections Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody()); List<Object> clients = (List<Object>) results.get('clients'); System.debug('Received the following clients:'); for (Object client: clients) { System.debug(client); } return clients; } else{ system.debug('Error making the callout'); } return null; } }
I'm executing this in the Developer Console in a Anonymous Window and the operation is Succesfull but no debug log is shown when I check the "Debug only" checkbox in the Logs Tab.
As you can see I want to know what the client is to see if it's returning the expected ones.
Debug logs are set to SFDC_DevConsole so that's ok and if I only write System.debug('hello') for example and only execute this in the Anonymous window it does log correctly in the Log Tab, so I can't figure out what the problem might be. Please help
Did you set the log category for Callouts as finest and see the results?
Related:https://salesforce.stackexchange.com/questions/139902/system-debug-not-displaying-in-debug-logs/139904
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_system_log_console.htm
Thanks
Your debug is inside a for, try System.debug(clients.size()); to validate this.
If it solves your issue please mark this as correct, it may help others.
In addition, can you make sure that the log size is within the limit(Each debug log must be 20 MB or smaller). See the article https://help.salesforce.com/articleView?id=code_debug_log.htm&type=5