From 9994273d25cd836f5fbd153015287fc0b60a4ece Mon Sep 17 00:00:00 2001 From: Collin Diekvoss Date: Thu, 20 Aug 2026 14:29:37 -0500 Subject: [PATCH] fix(router): send Caddy access logs to stdout instead of per-site files Bare `log` in the Caddyfile defaults to a per-vhost file under /var/log/caddy/, which never reaches Grafana. The router already ships its full systemd journal to Loki (monitoring module's loki.source.journal "systemd", unfiltered by unit), so pointing Caddy's access log at stdout gets it into that existing pipeline for free. --- configurations/nixos/router/virtual-hosts.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configurations/nixos/router/virtual-hosts.nix b/configurations/nixos/router/virtual-hosts.nix index cb5b92b..167250c 100644 --- a/configurations/nixos/router/virtual-hosts.nix +++ b/configurations/nixos/router/virtual-hosts.nix @@ -53,8 +53,12 @@ ]; extraConfig = let + # stdout -> journal -> already shipped to Loki/Grafana by the + # monitoring module's loki.source.journal "systemd" block. logBlock = '' - log + log { + output stdout + } ''; forwardAuthBlock = lib.optionalString (forwardAuthGate && !selfSigned) '' forward_auth http://${homelab.authentik.ip}:9000 { -- 2.51.2