Logs, requests and metrics
What the app printed, every request it got, and how it is doing.
The app's output
Everything the app writes to standard output and standard error is kept for 30 days. This shows the last hour, oldest first:
$ shim logs
07:59:56 listening on 8080
07:59:58 ERROR TypeError: Cannot read properties of undefinedTimes are in UTC, with the date added when the range covers more than one day. --follow (or -f) keeps printing new lines as they come, usually within seconds. --json prints one JSON object per line. The same lines are in the Logs section of the app in the dashboard.
Time ranges and search
--since and --until take an age, a date or a time:
| Value | Means |
|---|---|
30s, 15m, 2h, 7d | That long ago. |
2026-12-01 | The start of that day in your time zone. |
2026-12-01T10:00 | 10:00 in your time zone. Seconds are optional. |
2026-12-01T10:00Z | 10:00 UTC. |
$ shim logs --since 2026-12-01T09:00 --until 2026-12-01T10:00Logs go back 30 days. --until can't be used with --follow. When a range holds more lines than one run prints, the command says so and gives the --since to carry on from.
--search keeps only the lines that contain the exact text, with the same capitals:
$ shim logs --since 7d --search "order 1042"Levels
When a line is a JSON object with a level field, Shim reads it. Plain lines that start with a level, such as ERROR or WARN, count too.
{"level":"error","msg":"payment failed","order":1042}shim logs marks error lines with ERROR and warnings with WARN; other lines are printed as they are. With --json, each line carries its level (error, warn, info or debug) when one was found, and an id.
The request log
One line for every request to the app's address, newest at the bottom:
$ shim logs --requests
TIME METHOD STATUS DURATION PATH OUTCOME REQUEST ID
07:55:00 POST 201 84 ms /api/orders 0c9d6f2e-6f1a-4c55-9a39-5f0e7b6f1d2a
07:56:40 POST 502 1.3 s /api/orders app failed 1b4e28ba-2fa1-4d2e-8a5c-3f1a2b3c4d5e
07:58:20 GET 302 3 ms /admin answered by Shim 2c5f39cb-3ab2-4e3f-9b6d-4a2b3c4d5e6fDURATION runs from the moment the request reached Shim to the end of the response. Paths are kept without the query string. The command shows the newest 1,000 requests in the range, which is the last hour unless you give --since or --until. --follow keeps printing new ones, and --json prints one JSON object per request.
A request shows up in the request log about a minute after it happens.
Narrow it down with any of these:
| Option | Keeps |
|---|---|
--status 5xx | One class of status codes: 2xx, 3xx, 4xx or 5xx. |
--status 404 | One status code. |
--method POST | One method. |
--path /api | Paths that start with this. |
What the outcomes mean
Most requests have no outcome: the app answered them. The others say what happened instead.
| Outcome | What happened |
|---|---|
| answered by Shim | Shim answered without asking the app: a sign-in page, or someone who is not on the list. The app never saw the request. |
| refused by Shim | Shim turned the request away, for example because its body was too large. |
| app failed | The app crashed or stopped without answering. |
| at its limit | The app was already handling as many requests at once as its plan allows. See Limits. |
| app not deployed | No version of the app was running. |
| Shim error | Something failed inside Shim. |
| cut short | The connection closed before the whole response was sent, often because the visitor left. |
One request and its output
Every request has an id. The app receives it in the x-shim-request-id header, and the visitor's response carries the same header (see Request ids). Pass the id to see the request and the lines the app wrote while handling it, indented below it:
$ shim logs --request-id 1b4e28ba-2fa1-4d2e-8a5c-3f1a2b3c4d5e
2026-12-01 07:56:40 POST 502 1.3 s /api/orders app failed 1b4e28ba-2fa1-4d2e-8a5c-3f1a2b3c4d5e
07:56:40 ERROR TypeError: Cannot read properties of undefinedWhen Shim can't link a request to the lines the app wrote for it, it shows the lines that mention the id instead, and says so. Logging the x-shim-request-id header with your own lines makes those easy to find.
Metrics
$ shim metrics
budget, last 24 hours
Requests 12,840
By status 2xx 12,100, 3xx 420, 4xx 224, 5xx 96
Server errors (5xx) 96 (0.7%)
Answered by Shim 380 (sign-in pages, people not on the list)
Typical response 84 ms
Slow response 1.3 s (1 in 20 is slower)
Slowest 1% 4.2 s or more| Number | What it counts |
|---|---|
| Requests | Every request to the app's address, including the ones Shim answered itself. |
| By status | Requests by the class of their status code. |
| Server errors (5xx) | Responses with a 5xx status, and their share of all requests. |
| At its limit | Requests turned away because the app was handling as many at once as its plan allows. Shown only when there were some. |
| Answered by Shim | Sign-in pages and people not on the list, answered before reaching the app. Shown only when there were some. |
| Typical response | Half of the requests took less than this. |
| Slow response | 1 in 20 requests took longer than this. |
| Slowest 1% | 1 in 100 requests took this long or longer. |
--range takes 1h, 24h (the default), 7d or 30d. --json also prints the numbers for each period within the range. Everything is measured where requests arrive at Shim, so response times include the wait for the app to start after a quiet spell.
These counts are not the monthly request count on the Limits page. That one counts the times the app itself ran, so requests Shim answered on its own are not in it.
Email alerts
Shim emails the owner of an app when:
- a deploy fails;
- the app reaches 80%, and then 100%, of its requests for the month;
- the app starts failing: at least 1 in 5 responses are server errors (5xx) over 5 minutes, with at least 10 requests in that time.
That is one email for each incident, not one for each error. Alerts are on unless you turn them off, either with Email alerts in the app's Settings in the dashboard, or with the command line:
$ shim alerts off $ shim alerts # show the setting $ shim alerts on