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

How to see server logs with pm2? #1003

Closed
gilthonweapps opened this issue Mar 12, 2016 · 2 comments
Closed

How to see server logs with pm2? #1003

gilthonweapps opened this issue Mar 12, 2016 · 2 comments

Comments

@gilthonweapps
Copy link

Hi,

I have installed parse-server locally on my Mac with MongoDB hosted on mLab for testing purpose.

My package.json is as follow:

{
  "name": "ParseServer",
  "version": "1.0.0",
  "description": "Home-made Parse Server",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "parse-server": "~2.1.0"
  },
  "scripts": {
    "start": "VERBOSE=1 node index.js"
  },
  "engines": {
    "node": ">=4.3"
  }
}

With "VERBOSE=1" and server launched with "node start index.js", I see all the queries in my terminal.

Now, if I launch the server with pm2 "pm2 start index.js -i 1 --name ParseServer" and then perform "pm2 logs", I don't see my queries.

So my question is, how can I see my queries when I use parse-server with pm2?

Thanks

@flovilmart
Copy link
Contributor

This will depend on your provider, your pm2 configuration and other parameters.
In a general note, you should not use pm2 (or nodemon or forever for that matter) if you don't know how to properly configure it.

@altagir
Copy link

altagir commented Aug 28, 2016

create a file named env.json in your parse node directory....
edit and enter in it:

[{
    "name"        : "NameOfYourApp",
    "script"      : "./index.js",
    "instances"   : 2,
    "env": {
        "VERBOSE" : "1",
        "DEBUG"   : "apn"
    }
}]

now run with :
pm2 start env.json

source: Unitech/pm2#83

regards

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