Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I see logs on parse-server?

Parse had a nice development command utility where you could read and stream logs.

Heroku has that, but it shows only Heroku logs, not Parse logs.

Is there some way to see a console.log or console.error statement now that we're all switching over to parse-server?

like image 237
buildsucceeded Avatar asked Mar 03 '16 15:03

buildsucceeded


People also ask

What is the parse Server?

Parse Server is an open source backend that can be deployed to any infrastructure that can run Node. js. You can find the source on the GitHub repo. Parse Server uses MongoDB or PostgreSQL as a database.

What is parse Server Back4app?

Parse Server is an open source Backend-as-a-Service(BaaS) framework initially developed by Facebook. The platform now has an active and robust community of fanatical developers who constantly innovate and strive to improve the already impressive and modular platform.


3 Answers

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).

like image 153
Nasedo47 Avatar answered Oct 06 '22 17:10

Nasedo47


The latest versions of Parse dashboard have Logs page out of the box

enter image description here

like image 44
Andrey Gordeev Avatar answered Oct 06 '22 15:10

Andrey Gordeev


If you have Heroku CLI installed you can run these lines inside your project

heroku logs    

for the last 100 lines or

heroku logs --tail    

to show logs in real time

like image 22
arxidon Avatar answered Oct 06 '22 15:10

arxidon