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

# qovery log

> Log viewing commands

## Overview

View and stream logs from any service — application, container, database, or job — running on Qovery.

## Commands

### Stream Logs

Stream real-time logs:

```bash theme={null}
qovery log
```

Stream logs for a specific service (regardless of its type):

```bash theme={null}
qovery log --service "httpbin"
```

Follow logs with live updates:

```bash theme={null}
qovery log --service "httpbin" --follow
```

Filter logs by keyword:

```bash theme={null}
qovery log --service "httpbin" --filter "ERROR"
```

### Historical Logs

Get logs from last hour:

```bash theme={null}
qovery log --service "httpbin" --since 1h
```

Get logs from specific time range:

```bash theme={null}
qovery log \
  --service "httpbin" \
  --from "2024-01-01T00:00:00Z" \
  --to "2024-01-01T23:59:59Z"
```

Get last N lines:

```bash theme={null}
qovery log --service "httpbin" --tail 100
```

## Options

| Flag            | Description                                                                                   |
| --------------- | --------------------------------------------------------------------------------------------- |
| `--service`     | Service name — tries application, container, database, and job APIs until a match is found    |
| `--service-id`  | Service UUID — directly stream logs by ID, skips name lookup (use with IDs from console URLs) |
| `--application` | Target specifically an application                                                            |
| `--container`   | Target specifically a container                                                               |
| `--database`    | Target specifically a database                                                                |
| `--job`         | Target specifically a job                                                                     |
| `--follow`      | Follow log output                                                                             |
| `--filter`      | Filter logs by keyword                                                                        |
| `--since`       | Show logs since duration (e.g., 1h, 30m)                                                      |
| `--from`        | Show logs from timestamp (ISO 8601)                                                           |
| `--to`          | Show logs until timestamp (ISO 8601)                                                          |
| `--tail`        | Number of lines to show from end                                                              |
| `--help`        | Show help                                                                                     |

## Examples

### Follow Service Logs

```bash theme={null}
# Stream logs in real-time — works for any service type
qovery log --service "httpbin" --follow

# Filter for errors
qovery log --service "httpbin" --follow --filter "ERROR"
```

### Use Service ID from Console URL

When you have a Qovery console URL, you can use the service ID directly:

```bash theme={null}
# Extract the ID from a URL like:
# .../service/2c69dfd4-1c5a-44c3-ac65-8c6399cfbf31/service-logs
qovery log --service-id "2c69dfd4-1c5a-44c3-ac65-8c6399cfbf31"
```

### Debug Production Issues

```bash theme={null}
# Get last hour of logs
qovery log \
  --service "my-api" \
  --since 1h \
  --filter "exception"

# Get specific time range
qovery log \
  --service "my-api" \
  --from "2024-12-01T10:00:00Z" \
  --to "2024-12-01T11:00:00Z"
```

### View Database Logs

```bash theme={null}
# Stream database logs — no need to specify the type
qovery log --service "postgres-main" --follow
```

### View Job Logs

```bash theme={null}
# View cronjob logs
qovery log --service "backup-job" --tail 50
```

### Multiple Filters

```bash theme={null}
# Combine flags for precise debugging
qovery log \
  --service "my-api" \
  --since 30m \
  --filter "ERROR" \
  --tail 100
```

## Tips

<Tip>
  Use `--service-id` with the UUID from your Qovery console URL to stream logs
  without needing to know the service name. The ID is visible in the URL when
  you navigate to a service in the console.
</Tip>

<Tip>
  Use `--service` when you don't know (or don't want to specify) the type of
  your service. Qovery will try each API (application, container, database, job)
  until it finds a match. Use a specific flag (`--application`, `--database`,
  etc.) if you want to target a precise service type.
</Tip>

<Tip>
  Use `--follow` to monitor logs in real-time during deployments or debugging.
</Tip>

<Tip>
  Combine `--filter` with error levels like "ERROR", "WARN", "FATAL" to quickly
  find issues.
</Tip>

<Tip>
  The `--since` flag accepts: `s` (seconds), `m` (minutes), `h` (hours), `d`
  (days).
</Tip>

## Related Commands

* [`qovery shell`](/cli/commands/shell) - Execute commands in container
* [`qovery status`](/cli/commands/status) - Check service status
