> ## Documentation Index
> Fetch the complete documentation index at: https://docs.springwinter.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# View and Tail Logs for Your Springwinter Resources

> Read build and runtime logs for web servers, workers, and static websites streamed live from AWS CloudWatch in your own AWS account.

Logs for every web server, worker, and static website are stored in AWS CloudWatch inside your own AWS account. Springwinter surfaces them in the dashboard and through the API so you can read, tail, and troubleshoot output without leaving the platform or opening the AWS Console.

## What You See

Springwinter exposes two categories of log output for each resource:

<CardGroup cols={2}>
  <Card title="Build Logs" icon="hammer">
    Output from the container image build step — package installs, compile steps, and any errors that prevented a successful build.
  </Card>

  <Card title="Runtime Logs" icon="terminal">
    Live stdout and stderr from your running service containers. Everything your application writes to standard output appears here.
  </Card>
</CardGroup>

## Reading Logs in the Dashboard

Follow these steps to tail logs for any running resource.

<Steps>
  <Step title="Open your project">
    Navigate to your project from the Springwinter dashboard and select the resource you want to inspect — a web server, worker, or static website.
  </Step>

  <Step title="Click the Logs tab">
    Select the **Logs** tab on the resource detail page. The dashboard connects to CloudWatch and streams the most recent log lines in real time.
  </Step>

  <Step title="Tail or scroll">
    New log lines appear automatically at the bottom of the stream. Scroll up to review historical output within the loaded window.
  </Step>
</Steps>

## Reading Logs via the API

You can also fetch log output programmatically. All log endpoints stream CloudWatch output for the specified resource.

<Tabs>
  <Tab title="Web Servers">
    Fetch live runtime logs for a deployed web server:

    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/web_servers/{id}/logs \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Workers">
    Fetch logs for a background worker:

    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/workers/{id}/logs \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Static Websites">
    Fetch build logs for a static website deployment:

    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/static_websites/{id}/logs \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>
</Tabs>

### Log API Reference

<AccordionGroup>
  <Accordion title="GET /api/projects/{project_id}/web_servers/{id}/logs">
    Returns the CloudWatch log stream for the specified web server. The response streams recent log lines from your AWS CloudWatch log group.

    **Path parameters**

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the web server.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the web server resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/workers/{id}/logs">
    Returns the CloudWatch log stream for the specified worker.

    **Path parameters**

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the worker.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the worker resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/static_websites/{id}/logs">
    Returns build logs for the specified static website. These logs reflect the most recent deployment build.

    **Path parameters**

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the static website.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the static website resource.
    </ParamField>
  </Accordion>
</AccordionGroup>

## Log Retention and Ownership

<Tip>
  Logs remain in your AWS CloudWatch log groups even after you delete the resource in Springwinter. You control the retention policy directly in the AWS Console under **CloudWatch → Log groups**.
</Tip>

<Note>
  Springwinter reads logs from CloudWatch on demand — it does not copy, index, or store your log data on its own infrastructure. All log data stays in your AWS account at all times.
</Note>
