Modulify

Read the site server logs

get_site_logs

Reads the recent server logs of a site, the same stream the Logs panel shows.

Pass preview for the development machine that runs while someone is building, or production for the published site. Up to 300 lines come back newest last, each prefixed with its timestamp where the line carries one. A site with no machine running answers with a single line saying so rather than an error, so open the preview or publish first.

Nothing is stored between calls. The first call after a quiet spell returns only what is in flight at that moment, and the buffer fills toward its cap only while you keep reading, so poll across a few calls rather than expecting one to hold the history.

It answers why a site is erroring, whether an API route ran and what the server printed, so read it after a change rather than guessing from the code. Logs carry whatever the site prints, which can include values read from environment variables, and the tool tells the client never to repeat a log line anywhere it would be published. See Logs.

Inputs

Input Type Required Description
projectId string Yes The site id.
environment string No preview for the machine behind the live preview, or production for the published site. Defaults to preview, and any other value is refused before the tool runs.