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

# logs

> View and tail logs for deployments and jobs.

# cirron logs

View and follow logs for your Cirron project environments (development, staging, production, etc.).

## Usage

```bash theme={null}
cirron logs [options]
```

## Options

| Option         | Description                                   | Default    |
| -------------- | --------------------------------------------- | ---------- |
| `--env, -e`    | Target environment (dev, staging, prod, etc.) | production |
| `--lines, -n`  | Number of log lines to show (string)          | "100"      |
| `--follow, -f` | Follow logs in real time (like tail -f)       | false      |

## Examples

### Show Recent Logs

```bash theme={null}
# Show last 100 lines (default)
cirron logs

# Show last 200 lines
cirron logs --lines 200

# Show logs for staging environment
cirron logs --env staging
```

### Follow Logs in Real Time

```bash theme={null}
cirron logs --follow

# Follow logs for development environment
cirron logs --env development --follow
```

## Output

* Logs are timestamped and color-coded by level (INFO, WARN, ERROR, DEBUG)
* When following logs, new entries are fetched every 2 seconds
* Press Ctrl+C to stop following logs

#### Example Output

```bash theme={null}
12:34:56 INFO  Project started successfully
12:34:57 WARN  Using default configuration
12:34:58 ERROR Failed to connect to database
```

## How It Works

### Standard Mode

* Fetches the specified number of log lines (default: 100)
* Displays logs with timestamps and color-coded levels
* Exits after displaying logs

### Follow Mode

* Initially fetches recent logs
* Polls for new logs every 2 seconds
* Fetches up to 50 new log entries per poll
* Continues until interrupted with Ctrl+C
* Shows a spinner while fetching logs

## Troubleshooting

* **No cirron.yaml**: Run `cirron init` to create a project config.
* **Not Authenticated**: Run `cirron auth login` to authenticate.
* **No Logs Found**: Check that your project has been built and deployed.
* **API Errors**: Check your network connection and API credentials.

## Best Practices

* Use `--follow` during deployments or debugging
* Use `--lines` to limit output for large logs
* Always check logs after failed builds or deploys
* The follow mode is ideal for monitoring real-time application behavior

## Related

* [Deploy Command](./deploy)
* [Env Command](./env)
