Skip to content

Cloud Code is not logging into log files by default? #1118

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
3 tasks done
OlivierVoyer opened this issue Mar 21, 2016 · 2 comments
Closed
3 tasks done

Cloud Code is not logging into log files by default? #1118

OlivierVoyer opened this issue Mar 21, 2016 · 2 comments

Comments

@OlivierVoyer
Copy link

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

parse-server 2.2.0 running locally or hosted in AWS

Steps to reproduce

  • Setup a basic parse-server with the default options
  • Add a cloud code function that is using logging calls
Parse.Cloud.define("hello", function(request, response) {
    console.log("TEST LOG");
    console.warn("TEST WARN");
    console.error("TEST ERROR");
    response.success("OK");
});
  • Call this cloud code function from REST API

Logs/Trace

  • The unformatted logs appear in the Terminal window
  • No log file is created in ./logs

parse-server-example running on port 1337.

POST /parse/functions/hello { host: 'localhost:1337',
  'user-agent': 'curl/7.43.0',
  accept: '*/*',
  'x-parse-application-id': '*****',
  'x-parse-rest-api-key': '*****',
  'content-type': 'application/json',
  'content-length': '2' } {}
TEST LOG
TEST WARN
TEST ERROR
response: {
  "response": {
    "result": "OK"
  }
}

Is there anything to setup so that console.log, console.warn and console.error calls are redirected to the default winston logger?

@greatis
Copy link

greatis commented Mar 29, 2016

I have the similar problem with no luck.

@hramos
Copy link
Contributor

hramos commented Apr 2, 2016

This is working as intended. You need to configure FileLoggerAdapter in order to enable writing logs to disk.

See Fosco's comment in #781 for an example of how the FileLoggerAdapter can be set up.

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

@hramos hramos closed this as completed Apr 2, 2016
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