Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Code logs not working; VERBOSE=1 does work #2244

Closed
TheMikeCannell opened this issue Jul 9, 2016 · 4 comments
Closed

Cloud Code logs not working; VERBOSE=1 does work #2244

TheMikeCannell opened this issue Jul 9, 2016 · 4 comments
Milestone

Comments

@TheMikeCannell
Copy link

I have setup parse server on AWS. I have connected my iOS app to it however I am getting errors returned to the xcode console. This code did not error on parse.com hosted server. In order for me to track down what the error is I need to see the cloud code logs.

I have set up parse dashboard locally and it connects however, there are no logs. Before you close this as a duplicate: I have setup FileAdapterLogger as stated in --> #781

My elastic beanstalk server is healthy and the app calls the CC. If I use "verbose: 1" in my index.js I get a TON of output into the log files in parse dashboard. I need to see just the cloud code logs including errors in the error log.

This is my setup:

var logger = require('parse-server/lib/Adapters/Logger/FileLoggerAdapter').FileLoggerAdapter;

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://xxxxxxxxxxxxxxxxxxxxxxxx',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  masterKey: process.env.MASTER_KEY || 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
  serverURL: process.env.SERVER_URL || 'http://xxxxxxxxxxxxxxxxxxxx/parse/',
  loggerAdapter: new logger({ logsFolder: './' })
});

Expected Results

I need to have cloud code logs working in locally hosted dashboard.

Actual Outcome

"No logs in the last 30 days"

Environment Setup

  • Server
    • parse-server version: latest
    • Operating System: latest
    • Hardware: latest
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): AWS
  • Database
    • MongoDB version: latest
    • Storage engine: latest
    • Hardware: latest
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab

I've set this all up this week so every version is the latest

@tanmays
Copy link

tanmays commented Jul 10, 2016

Logs in Dashboard are unfortunately pretty useless right now. Logs being such an important part of development I'm not sure why bringing them on feature parity with parse.com isn't high on the priority list.

I did post a similar request here parse-community/parse-dashboard#376

Edit: I think this is being worked upon #2028

@TheMikeCannell
Copy link
Author

TheMikeCannell commented Jul 11, 2016

I could deal with having to use verbose. What I can't deal with is error messages like this:

2016-07-11T16:36:34.775Z - error:
2016-07-11T16:36:34.770Z - error:

What am I supposed to do with that? Pointing the app to parse.com doesn't return an error. The cloud code methods called all work just fine. The error handling I wrote in cloud code is returning to Xcode console:

Error with trunkQuery.find() [object Object] (Code: 141, Version: 1.12.0)

However in the verbose log it prints out every object it is returning, which is hundreds of objects.

@flovilmart
Copy link
Contributor

@tanmays we welcome pull requests and trying our best to provide a stable platform. We gladly welcome pull requests, that can simply be adding info logs for cloud code requests etc...

And yes you're right, I didn't put much focus into logging, as I don't use parse-dashboard for logging and I capture request/response logs differently.

@TheMikeCannell
Copy link
Author

So I have figured out the problem with my cloud code failing. I need to update it to run on Javascript SDK 1.7. I've been going through and changing current user and master key. However it still doesn't run. And again the log output is:

error:

Is there any better way to debug this error. My code is:

callback.error("Error with myQuery.find()"+error);

This returns the error to Xcode as such:

Error: Error Domain=Parse Code=141 "Error with myQuery.find() [object Object]" UserInfo={code=141, temporary=0, error=Error with myQuery.find() [object Object], NSLocalizedDescription=Error with myQuery.find() [object Object]}

Is there a better way to understand WHICH line the offending code is on? It's hard to update code for the new version without know which lines are breaking. I suppose I could go line for line and see if the syntax is right for 1.7 but that would take forever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants