Logs
Everything your app writes with console.log, console.warn and console.error, and every exception it doesn’t catch, goes into its log. So does everything a container app writes to stdout and stderr. Lines show up a few seconds after they’re written.
When your app answers with a 500, or Cloudflare’s error 1101 (the Worker threw), this is where to look first.
Read them
Section titled “Read them”jiayang logs acme/hello10:04:30 LOG v3 GET /pay charging order 118210:04:31 ERROR v3 GET /pay TypeError: Cannot read properties of undefined (reading 'id') at charge (index.js:42:17)Each line has the time in UTC, the level, the version that was live, the request that set the app going, and what the app wrote. It shows the last hour, oldest first. --follow keeps printing new lines until you stop it:
jiayang logs acme/hello --follow| Flag | Shows |
|---|---|
--since 15m |
Lines from that far back: 30s, 15m, 2h, 1d, or an RFC 3339 time. The default is 1h. |
--level warn |
Lines at that level or louder: debug, info, warn or error. |
--version 3 |
Lines written while version 3 was live. |
--search "order 1182" |
Lines with that text in them. Not case-sensitive. |
--limit 500 |
Up to that many lines before following. The default is 100. |
--json prints the page as JSON, or one line of JSON per log line with --follow.
In the dashboard, the app’s Logs tab shows the same lines and follows new ones while the tab is open. An agent reads them with the app_logs tool.
Who can read them
Section titled “Who can read them”The app’s editors and owners, and the workspace’s owners and admins. Someone the app is shared with as a viewer, in the workspace or not, can open the app but not its logs, which can hold anything your code printed about the people using it:
error: acme/hello's logs are for its editors and owners, and the workspace's owners and admins: You don't have permission to do that.What’s kept
Section titled “What’s kept”Only what your app writes. The platform doesn’t log each request into your app’s log: jiayang watch and the audit log show those.
Before a line reaches you, the platform takes out:
- anything shaped like a signed token, such as the identity token in
X-Jiayang-Identityif your code prints its request headers - the platform’s own tokens (
jyb_,jyu_and the like) - query strings from the request line
- terminal control codes
Everything else is what your app wrote, so keep secrets and personal data out of your own log lines.
Lines are kept for as long as your plan says, and can’t be read after that:
| Plan | Kept | Lines a day |
|---|---|---|
| Free | 1 day | 20,000 |
| Team | 7 days | 100,000 |
| Business | 7 days | 500,000 |
Lines a day counts every app in the workspace, from midnight UTC. Once the workspace reaches it, logging stops until the next UTC day, and what the apps write meanwhile isn’t kept. jiayang logs and the dashboard say when that has happened. Your apps keep running either way.
Nothing shows up
Section titled “Nothing shows up”- Lines take a few seconds to arrive. Try again, or use
--follow. - Check
--since: the default is the last hour. - The workspace may have reached its lines for the day.
jiayang logssays so. jiayang logssays reading logs isn’t switched on for this platform yet: the platform can’t read them for now, and its operator has been told. Your apps’ lines are still kept, for 7 days, and show up once it can.- A container’s output only counts once the container has started. A container that never starts writes nothing: see Container apps.