Two months ago we announced that the CLI now allows you to observe the traffic of your locally emulated project with runtime logs.
Today, we're announcing the roll-out of the Logs tab in the dashboard that allows you to stream and inspect logs for a project deployed in production on the Grafbase platform, as well as an equivalent CLI command.
If you already have a project deployed with Grafbase, you can head straight to the dashboard and open the Logs tab of a project.
Here you'll observe logs streamed in as your project sees new traffic coming in. You can click on an individual log entry to see a tab pane with details such as status code or region of the request within which a log entry is generated. The stream will include entries for the outer GraphQL requests as well as messages logged by functions such as resolvers or authorizers. The page not only provides a stream of log entries as they come in (which you can pause), but also a historical view of the latest entries. Right now log entries are kept around for an hour.
At the same time, the newest CLI version includes an equivalent logs
command that allows you to stream the logs from the comfort of your terminal.
Try one of the following:
npx grafbase logs {account_slug}/{project_slug}
or a short-hand when your project belongs in your personal account:
npx grafbase logs {project_slug}
You can even pass the URL of the particular deployed environment:
npx grafbase logs https://my-project-main-my-account.grafbase.app
or, in a current directory containing a Grafbase project linked to with grafbase link
or initiated with grafbase create
, you can leave out arguments altogether.
npx grafbase logs
will start streaming logs for the deployed version corresponding to your local project.
We'd also love to hear any of your feedback and ideas, so join us on Discord.