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

Not able to see Parse Logs in AWS Elastic Beanstalk #781

Closed
sprabs opened this issue Mar 3, 2016 · 11 comments
Closed

Not able to see Parse Logs in AWS Elastic Beanstalk #781

sprabs opened this issue Mar 3, 2016 · 11 comments

Comments

@sprabs
Copy link

sprabs commented Mar 3, 2016

In my Parse app that is hosted on parse.com, there's an easy place to see the logs for Cloud Code (i.e, calls made, inputs, outputs). In my new test Parse app that is hosted on AWS Elastic Beanstalk, I am unable to see those same logs. I am able to tail logs in /var/log, but those do not send back Cloud Code errors. It only shows high-level nodejs errors and also log statements from code that is being executed.

Is there something we have to enable (I noticed there is a logs folder that's empty in /var/app/current) or do we have to setup those logs ourselves?

@sprabs
Copy link
Author

sprabs commented Mar 3, 2016

I'm also not able to see the errors on the client side in the debugger. It's almost like the error is not being passed back?

@peterdotjs
Copy link
Contributor

@sprabs you'll need to select the loggerAdapter and use info/error explicitly for logging. Wiki details, and test for an example. We currently only have a FileLogger adapter.

@boardmain
Copy link

can you show an example on how to setup the filelogger? im trying to use it with the parse serve example but without success

@gfosco
Copy link
Contributor

gfosco commented Mar 7, 2016

Here's an example:

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

// ...

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost:1337',  // Don't forget to change to https if needed
  loggerAdapter: new logger({ logsFolder: './' })
});

@peterdotjs do we / can we expose this adapter in an easier fashion?

@gfosco gfosco closed this as completed Mar 7, 2016
@boardmain
Copy link

thank you, yes i found it, i was thinking the Adapter was exported by parse-server like the s3 adapter
thank you

@prodigy2m
Copy link

prodigy2m commented Jun 14, 2016

Hi this example gives me error: loggerAdapter: new logger({ logsFolder: './' }),
^
TypeError: logger is not a function
at Object. (/root/parse-server-example/index.js:27:18)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:148:18)
at node.js:405:3

@TheMikeCannell
Copy link

@prodigy2m verify that you have this line as well:
var logger = require('parse-server/lib/Adapters/Logger/FileLoggerAdapter').FileLoggerAdapter;

@yairsz
Copy link

yairsz commented Oct 15, 2016

This is now referenced in the wiki page:
https://github.com/ParsePlatform/parse-server/wiki/Configuring-LoggerAdapter

@mer10z
Copy link

mer10z commented Feb 16, 2017

FileLoggerAdapter is no longer part of parse-server and the link to configure LoggerAdapter on the wiki is broken. I couldn't find any up to date documentation for logging from cloud code, so I just npm installed winston and logged to my own file.

@acinader
Copy link
Contributor

@mer10z I'm deployed on beanstalks and I wrote an adapter to publish parse-server logs to AWS firehose which will aggregate logs from a cluster into a nice searchable gui.

https://www.npmjs.com/package/parse-aws-firehose-logger-adapter

if you want to use it and have any issues let me know...

@gateway
Copy link

gateway commented Apr 17, 2018

@acinader I'm having to bring up a new parse server in aws, I was looking how people where handling logs, I went to the link you posted and it says "This package is no longer maintained as I no longer use it for my project", are you still using this or is their another way to see streamed parse logs and save them to s3?

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

10 participants