Files
LocalAI/core/cli
Ettore Di Giacinto b129694ffe feat(http): add an opt-in client address to the access log
Operators could not tell which client sends requests that are refused
with 401. Add --log-client (LOCALAI_LOG_CLIENT, off by default). When
set, the HTTP request log line also carries duration, remote, user_agent
and, when present, request_id.

The address is the TCP peer. It is never read from X-Forwarded-For,
X-Real-Ip or Forwarded, because LocalAI has no trusted-proxy setting and
any client can forge those headers. Behind a reverse proxy the value is
the proxy address. Authorization headers, cookies, query strings and
bodies are never logged. User agent and request id are cut to a fixed
length and have control characters replaced.

Assisted-by: Claude:claude-sonnet-5-5 go gofmt
2026-11-03 14:32:55 +00:00
..