# GET /services/{name}/log

First published 14 Oct 2026 (release 0.2.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the services group.

Get recent journal and log lines for a daemon

- Who may call it: administrator
- Token scope, any of: settings, read, all
- Answers: 200 OK

The response includes the last lines from the systemd journal for the daemon's unit and from the daemon's own log if it is readable.

The default is 50 lines per source. Set lines to a value from 1 to 500 to change the limit for each source. Invalid name syntax or an invalid lines value returns HTTP 400.

## As a command

- [urbestack-service-log](https://urbestack.com/docs/commands/urbestack-service-log.md): Shows the last lines of output from journalctl -u for a daemon's systemd unit and from the daemon's own log if it is readable.

## Parameters

- `name` (path, string, matching ^[a-z][a-z0-9.-]{0,39}$, required): UrbeStack daemon name returned by GET /services, such as postfix, php-8.3, panel-web, or mariadb.
- `lines` (query, integer, 1 to 500)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X GET "$API/services/alice/log?lines=1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "journal": "text",
  "lines": 1,
  "log": "",
  "log_path": "text",
  "name": "alice",
  "unit": "text"
}
```

## Errors

- 400: --name is required
- 400: A daemon is named with letters, digits, dots and hyphens
- 400: lines is 1 to 500
- 401: Authentication required
