4

Basically with default parse setup on AWS server. I want to debug my cloud code I recently updated with Promise, Arrow Functions, useMasterKey:true.. stuffs like these.

What I am expecting? I have defined a hello world cloud functions

Parse.Cloud.define("hello", (request, response) => {
    console.log("Hello world Log Test");
    var user=request.user;
    console.log("Request: "+user);
    response.success("Hello world!");
});

And Output I am getting on Parse Dashboard

2017-02-02T06:27:10.219Z - Ran cloud function hello for user OR2jnwUjmF with:
  Input: {"userTest":"This is so stupid"}
  Result: "Hello world!"

I have noticed logs on Parse Dashboard is only of Request and Response.

console.log(..) method is not working.

Eventually I had some google work with https://github.com/ParsePlatform/parse-server/wiki/LoggerAdapter.js

But is not enough to understand. Without logs it is impossible for me to check other functionalities.

JavaQueen
  • 1,155
  • 2
  • 19
  • 44
OS Idris
  • 99
  • 1
  • 9

2 Answers2

3

I did this to have some logging, using latest parse-server (2.5.3). In main.js:

const logger = require('parse-server').logger;
Parse.Cloud.define('test', (request, response) => {
  logger.info('info test');
}

It uses default winstonjs logger: https://github.com/winstonjs/winston#using-the-default-logger

BartBiczBoży
  • 2,512
  • 2
  • 24
  • 33
0

To view console.logs, you can actually run your parse locally and use jsbin to test call your cloude code. From there, you can go back to your local server(from cmd) to view the log

Lyon
  • 272
  • 1
  • 12