Logs and status
Copy page
Grayspar keeps what your service prints to its standard output and standard error, so you can see what happened when something goes wrong. The dashboard shows the same logs in each service’s menu.
Read a service’s logs
Section titled “Read a service’s logs”To print what a service has printed, with the time on each line, run grayspar logs. To keep following new lines as they arrive, add -f:
grayspar logsgrayspar logs -fWhen a project has several services, name the service with --service:
grayspar logs --service apiGrayspar keeps log lines for a period set by your plan. An app that prints in a tight loop has some of its lines dropped.
Read a build log
Section titled “Read a build log”To read the log of the last build, add --build. To follow a build that is still running, add -f as well:
grayspar logs --buildWhen a build fails, grayspar deploy prints the end of the build log, along with this command for the rest. When a service builds and then fails to start, grayspar deploy points you to grayspar logs.
Restart a service
Section titled “Restart a service”To start a fresh copy of the running version, run grayspar restart. The copy keeps the same image, variables and volume, and nothing is built:
grayspar restartRestarting app.To follow it, rungrayspar statusA restart deletes the files your app wrote outside its volume. An app that crashes also starts again by itself, and Grayspar waits a little longer after each crash.
Check a service’s status
Section titled “Check a service’s status”To see each service’s address and status, run grayspar status:
<project-name>
SERVICE URL STATUSapp https://<project-name>.grayspar.com RunningEach service shows one of six statuses:
| Status | Meaning |
|---|---|
| Deploying | A new version is starting and hasn’t gone live yet. |
| Running | The service is up. |
| Restarting | A fresh copy is starting. |
| Crashed | The app has stopped. |
| Unknown | Grayspar hasn’t heard from the server running this service for a short while. |
| Failed | The first deploy never went live. |
When an app stops answering, or nothing has gone live yet, the people you shared the project with see a page saying so at the project’s address. Refreshing that page tries again.