Log Streaming

Run fuku logs in a second terminal. Filter by service. Color-coded prefixes. Your TUI stays clean.

How it works

Unix socket transport

While fuku is running, you can open another terminal and stream logs using fuku logs. Logs are streamed over Unix sockets with low latency and service name prefixes for easy filtering.

Each project gets its own socket, /tmp/fuku-<fingerprint>.sock, named after a fingerprint of the project directory. Run fuku logs from the project directory and it reaches the instance started there, even when another project runs a profile with the same name.

fuku · log streaming
$ fuku logs api auth
api    │ 2024-03-15T10:23:01Z INF server listening on :8080
api    │ 2024-03-15T10:23:05Z INF GET /health 200 1ms
auth   │ 2024-03-15T10:23:01Z INF auth service started
api    │ 2024-03-15T10:23:12Z INF POST /api/users 201 45ms
auth   │ 2024-03-15T10:23:12Z INF token issued user=john
api    │ 2024-03-15T10:23:15Z WRN rate limit approaching endpoint=/api/users
api    │ 2024-03-15T10:23:18Z INF GET /api/users 200 12ms
Usage

Stream and filter

terminal
# Stream logs from all services
fuku logs

# Stream logs from specific services
fuku logs api auth

# Filter by profile
fuku logs api --profile core

# Short alias
fuku l api worker
Automation

Bounded reads

Scripts and AI agents need a log read that ends on its own. --tail limits the buffered replay, --no-followexits once that replay has been written, and --no-ui drops the logs panel and the ctrl+c footer while keeping the log lines and errors.

terminal
# Replay at most the newest 100 buffered messages, then keep following
fuku logs api --tail 100

# Replay the buffered messages and exit
fuku logs api --no-follow

# Everything an agent needs: no panel, at most 100 buffered messages, then exit
fuku logs api frontend-api --profile core --no-ui --tail 100 --no-follow

The two flags are independent: --tail does not stop following, and --no-follow does not apply a limit. The limit applies after service filtering, across the whole selected stream rather than per service. A --tail value must be greater than zero.

Output control

Per-service output

Control which output streams are captured for each service:

fuku.yaml
services:
  api:
    dir: ./api
    logs:
      output: [stdout] # Only capture stdout

  worker:
    dir: ./worker
    logs:
      output: [stdout, stderr] # Both streams (default)

Valid values: stdout, stderr. When omitted, both streams are captured.

Tuning

Buffer configuration

Control the socket log streaming buffer size:

fuku.yaml
logs:
  buffer: 1000 # Buffer size (default: 1000)

Ready to try it out?

Get Started