Forum Academy Marketplace Showcase Pricing Features

Where can I see the console.log printed statements in the plugin I made

I have this server-side action js code:

function(properties, context) {
    
    // NOTE: all the necessary params. 
    params
    let headers = {
        'Content-Type': 'application/json'
    }
    paramsToSend = {
        loginId: loginId,
        password: password,
        customerId: customerId,
        startDate: startDate,
        endDate: endDate,
        resultsPerPage: resultsPerPage,
        showExternal: showExternal
    }
    
    var options = {
        method: 'GET',
        uri: 'https://api.konnektive.com/order/query/',
        headers: headers,
        json: paramsToSend
    }
    
    var requestSent = context.request(options);

    console.log(requestSent.statusCode);
    
    if (requestSent.statusCode.toString().charAt(0) !== "2") {
        return {
            product_items: productItems
        }

    } else {
        let retrievedData = requestSent.body.data
        productItems.push
        return {
            product_items: retrievedData
        }
    }
}

I can’t see aywhere the console.log I printed when I try to inspect the page and look at the console.

1 Like

Server side actions (SSA) console logs aren’t visible in the browser - they are logged on the server. So visible in the Editor logs section.

This will help Can you write to Bubble log from Server-side plugin?

Personally I find the server logs very clumsy and instead return a debug text field in SSA.

Good luck. :slightly_smiling_face:

Also @vini_brito plug-in course is good value. Look for links in the forum.

2 Likes

I just retrieved the return message of the log and set the state of an element to display the return message. This worked for me.