If you use PM2
, it is really easy to see logs.
For my project, I have parse-server and parse-dashboard running on my server.
Here is the PM2 config I use for them:
{
"apps": [
{
"script": "parse-server",
"args": "config/server.json",
"log_file": "logs/server.log",
"error_file": "logs/server-error.log",
"log_date_format" : "YYYY-MM-DD HH:mm:ss Z",
"instances": 1,
"watch": true,
"ignore_watch": ["cloud", "logs"],
"env": {
"VERBOSE": "1"
}
},
{
"script": "parse-dashboard",
"args": "--config config/dashboard.json",
"log_file": "logs/dashboard.log",
"error_file": "logs/dashboard-error.log",
"log_date_format" : "YYYY-MM-DD HH:mm:ss Z",
"instances": 1,
"watch": true,
"ignore_watch": ["cloud", "logs"]
}
]
}
In my case, it is the "VERBOSE": "1"
argument that allows me to see all the queries executed by parse-server.
If you want to see the logs of both parse-server and parse-dashboard, you then only have to type pm2 logs
.
In my configuration, parse-server and parse-dashboard are installed globally (npm install -g parse-server
and npm install -g parse-dashboard
).