# projectLogs

```graphql
query ProjectLogs($input: ProjectLogsInput!) {
  projectLogs(input: $input) {
    data {
      timestamp
      level
      message
      service
      traceId
      requestId
      runId
      environment
      host
      releaseId
      metadata
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    stats {
      bytesProcessed
      linesProcessed
      queryTimeMs
    }
  }
}
```

List project log entries. Requires project.logs.read.

## Arguments

| Name                     | Type              | Required | Description                                                                    |
| ------------------------ | ----------------- | -------- | ------------------------------------------------------------------------------ |
| `input`                  | ProjectLogsInput! | Yes      |                                                                                |
| `input.projectReference` | String!           | Yes      |                                                                                |
| `input.start`            | String            |          |                                                                                |
| `input.end`              | String            |          |                                                                                |
| `input.cursor`           | String            |          |                                                                                |
| `input.limit`            | Int               |          |                                                                                |
| `input.sortOrder`        | LogSortOrder      |          | Sort order by timestamp. Defaults to desc, newest first. One of `asc`, `desc`. |
| `input.level`            | LogLevel          |          | One of `error`, `warn`, `info`, `debug`.                                       |
| `input.search`           | String            |          |                                                                                |
| `input.service`          | String            |          | veryfront-server, veryfront-api or veryfront-proxy.                            |
| `input.traceId`          | String            |          |                                                                                |
| `input.requestId`        | String            |          |                                                                                |
| `input.runId`            | String            |          |                                                                                |
| `input.environment`      | String            |          |                                                                                |
| `input.host`             | String            |          |                                                                                |
| `input.releaseId`        | String            |          |                                                                                |

## Variables

```json
{
  "input": {
    "projectReference": "string"
  }
}
```

## Responses

| Status | Description                              |
| ------ | ---------------------------------------- |
| 200    | The LogQueryResult! in data.projectLogs. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query ProjectLogs($input: ProjectLogsInput!) {\n  projectLogs(input: $input) {\n    data {\n      timestamp\n      level\n      message\n      service\n      traceId\n      requestId\n      runId\n      environment\n      host\n      releaseId\n      metadata\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n    stats {\n      bytesProcessed\n      linesProcessed\n      queryTimeMs\n    }\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "projectLogs": {
      "data": [
        {
          "timestamp": "string",
          "level": "string",
          "message": "string",
          "service": "string",
          "traceId": "string",
          "requestId": "string",
          "runId": "string",
          "environment": "string",
          "host": "string",
          "releaseId": "string",
          "metadata": {}
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      },
      "stats": {
        "bytesProcessed": 0,
        "linesProcessed": 0,
        "queryTimeMs": 0
      }
    }
  }
}
```
