# Get application logs (https://developer.godaddy.com/en/docs/references/rest/hosting/get-logs)

---
title: Get application logs
description: 'Returns log entries for the application, newest first.'
full: true
---

Full description

> Returns log entries for the application, newest first. The v2 endpoint always returns entries in the normalized shape defined by `LogEntry`: `timestamp`, `level` (`INFO`/`WARN`/`ERROR`), `source` (`STDOUT`/`STDERR`), and `message`. Entries whose raw level or source cannot be mapped to one of the values defined today are dropped, so no entry is returned carrying a value outside `LogLevel` or `LogSource`. Both enumerations may gain members in a future version of this specification, so clients must not fail on a value they do not recognise.   `variant` selects the environment (`PREVIEW` or `PUBLISH`), matching the `variant` field used by the restart request body. The service still honours two earlier spellings, `target` and `environment`, both deprecated; the precedence is `variant` > `target` > `environment`, and the first one supplied wins while the others are ignored. When none is supplied the environment defaults to `PREVIEW`. New clients should send `variant` only. `since` limits results to entries at or after the given timestamp; defaults to 24 hours ago and cannot exceed 7 days. `level` filters entries by severity after retrieval.

## GET /apps/{appId}/logs

Get application logs

Returns log entries for the application, newest first. The v2 endpoint always returns entries in the normalized shape defined by `LogEntry`: `timestamp`, `level` (`INFO`/`WARN`/`ERROR`), `source` (`STDOUT`/`STDERR`), and `message`. Entries whose raw level or source cannot be mapped to one of the values defined today are dropped, so no entry is returned carrying a value outside `LogLevel` or `LogSource`. Both enumerations may gain members in a future version of this specification, so clients must not fail on a value they do not recognise.

`variant` selects the environment (`PREVIEW` or `PUBLISH`), matching the `variant` field used by the restart request body. The service still honours two earlier spellings, `target` and `environment`, both deprecated; the precedence is `variant` > `target` > `environment`, and the first one supplied wins while the others are ignored. When none is supplied the environment defaults to `PREVIEW`. New clients should send `variant` only. `since` limits results to entries at or after the given timestamp; defaults to 24 hours ago and cannot exceed 7 days. `level` filters entries by severity after retrieval.


### Query parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `variant` | unknown | no | Environment to retrieve logs from. The canonical parameter; it takes precedence over the deprecated `target` and `environment`. Defaults to `PREVIEW` when none of the three is supplied. |
| `since` | unknown | no | Return only entries at or after this ISO 8601 timestamp (must include timezone offset). Defaults to 24 hours ago. Cannot exceed 7 days in the past. |
| `source` | unknown | no | Filter logs by source stream. Defaults to all streams. |
| `level` | unknown | no | Filter logs by severity level. |
| `pageToken` | unknown | no | Opaque pagination cursor. Clients should navigate by following `links[rel=next].href` from the previous response rather than constructing URLs manually; this parameter is documented so that the endpoint's contract is discoverable. |
| `pageSize` | integer | no | Maximum number of log entries to return. |

### Responses

**200** — Log entries, newest first.

Content-Type: `application/json`

Schema:

- schema reference: `#/components/schemas/PagedLogEntries`

**400** — The request body or parameters did not pass schema validation.

Content-Type: `application/json`

Schema:

- schema reference: `#/components/schemas/Error`

**401** — Authentication credentials are missing or invalid.

Content-Type: `application/json`

Schema:

- schema reference: `#/components/schemas/Error`

**403** — The caller is authenticated, but the request is not permitted: either the access token does not carry the scope this operation requires, or the operation is disabled for this account.

Content-Type: `application/json`

Schema:

- schema reference: `#/components/schemas/Error`

**404** — The requested resource does not exist.

Content-Type: `application/json`

Schema:

- schema reference: `#/components/schemas/Error`

**429** — Rate limit exceeded. A `429` response may come in one of two shapes: an empty body with `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` headers; or a JSON `Error` body with `Retry-After` and `RateLimit-*` headers. Clients should honour whichever headers are present and should not assume a JSON body is available on every `429`.

Content-Type: `application/json`

Schema:

- schema reference: `#/components/schemas/Error`

**501** — The request is contract-valid, but the operation, or a value the request names, is not applicable to this deployment. `details[].issue` is always `NOT_APPLICABLE`. For example, deployments and restarts are offered for `NODEJS` applications only, and a hosting product this deployment does not serve is answered here rather than with a `400`.

Content-Type: `application/json`

Schema:

- schema reference: `#/components/schemas/Error`

**503** — The service is temporarily unable to handle the request. Retry after a short delay. May include a `Retry-After` header hinting at when to retry.

Content-Type: `application/json`

Schema:

- schema reference: `#/components/schemas/Error`

**Security:** requires `bearerAuth`.
