Skip to content

How to enable parse-server logs ? #626

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

Closed
fraxool opened this issue Feb 24, 2016 · 13 comments
Closed

How to enable parse-server logs ? #626

fraxool opened this issue Feb 24, 2016 · 13 comments

Comments

@fraxool
Copy link

fraxool commented Feb 24, 2016

As described in the tutorial to send push notifications, I am trying to log the status of my notifications sent to my parse-server. In this tutorial, it is written :

If your Parse Server logs, you can see something similar to ...

Until now, here is my configuration :

var api = new ParseServer({
    databaseURI: 'mongodb://user:password@url:1111/App',
    cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
    appId: 'XXX',
    masterKey: 'XXX',
    clientKey: 'XXX',
    restAPIKey: 'XXX',
    push: {
        ios: {
            pfx: 'certificat/Certificats.p12',
            bundleId: 'com.xxx.xxx',
            production: false
        }
    }
});

How to enable logs on my Parse Server to get the status of my notifications ?

Thanks!

@thibauddavid
Copy link

Have you tried enabling verbose using export VERBOSE=1 before launching your server ?

@gateway
Copy link

gateway commented Feb 24, 2016

I think their is a /log endpoint you can call, I cant seem to find the docs on it right now though..

@peterdotjs
Copy link
Contributor

We have a LoggerAdapter and a /logs endpoint however specific to your question on the Push documentation, the logs are going through the console interface. cc: @wangmengyan95 to confirm.

@flovilmart
Copy link
Contributor

We don't track yet the status for push notifications, see #566.

@fraxool
Copy link
Author

fraxool commented Feb 25, 2016

Thanks for your answers guys!

@flovilmart then why is it written :

If your Parse Server logs, you can see something similar to ...

On this page ?

@gfosco
Copy link
Contributor

gfosco commented Feb 26, 2016

It may spew some logs as push is being handled, but it's not storing the push status in the database is what he means. Going to close this one, if there are any outstanding issues, please open a new issue. Thanks.

@gfosco gfosco closed this as completed Feb 26, 2016
@charliewilliams
Copy link

This issue is closed but ranks highly in Google and doesn't actually explain how to see logs in a parse-server environment. Can you please add a link or example?

@zurcjoe
Copy link

zurcjoe commented Mar 2, 2016

I second the motion - "This issue is closed but ranks highly in Google and doesn't actually explain how to see logs in a parse-server environment. Can you please add a link or example?"

@rsweny
Copy link

rsweny commented Mar 16, 2016

In Heroku you can set a config var "VERBOSE" to true. In index.js you should also be able to set:
process.env.VERBOSE=true;

@Jerland2
Copy link

can anyone go into this with a little greater depth? I am currently trying to access the parse server logs. I am using Heroku and mLabs. I have gone into Heroku and set a new config var "VERBOSE" to "true". My git server does not have a folder named logs and i cannot for the life of me find out where these logs would be. Thank you in advance.

Is my setting of the config vars done correctly?

If so, where are these logs located and how can i access them?

@rsweny
Copy link

rsweny commented Apr 15, 2016

On the Heroku Dashboard, on the top right of the main screen for your app there should be an icon with 3 vertical dots. Under there should be a view logs menu item. Lately it seems my logs are always VERBOSE though regardless of what I set.

@chadpav
Copy link

chadpav commented Apr 27, 2016

OK, for those coming here via Google search looking for logging.

I had used the line from @rsweny process.env.VERBOSE=true; above and that did enable verbose logging. Later I changed this value to false but couldn't understand why it was still logging at verbose levels.

I just figured out that if you set the environment variable 'VERBOSE' to anything it will log everything. I commented out that line so that variable is undefined and I'm back down to minimal logging + whatever I log to the console from cloud code.

Hope that helps, I think figuring out logging using their adapter and then figuring how to effectively monitor my app in AWS will be next on my list to do.

EDIT:
lol, just found that this effectively sets log level to 'silly' in ParseServer.js:

    if (verbose || process.env.VERBOSE || process.env.VERBOSE_PARSE_SERVER) {
      configureLogger({level: 'silly'});
    }

A better approach then would be to explicitly set verbosity in the ParseServer init:

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  verbose: false,
...

@duhovny
Copy link

duhovny commented Oct 27, 2016

@rsweny 's answer helped!

Since Heroku's UI changed, I'll add quick walkthrough:

  1. Go to Settings tab, click Reveal Config Vars and add VERBOSE=true variable
  2. In the top right corner of the screen there is "Open app" button and next to it "More". Click "More" and choose "View logs".

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