From 63f58c427e9f8d926d06a211e7d9d476d2eb6e8a Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sun, 15 Sep 2024 16:58:06 +0530 Subject: [PATCH] all: caddy - dump logs on stderr --- hosts/shared/caddy-helpers.nix | 8 ++------ hosts/shared/promtail.nix | 23 ----------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/hosts/shared/caddy-helpers.nix b/hosts/shared/caddy-helpers.nix index 1046238..2344ebc 100644 --- a/hosts/shared/caddy-helpers.nix +++ b/hosts/shared/caddy-helpers.nix @@ -1,11 +1,7 @@ { logFormat = fileName: '' - output file /var/log/caddy/${fileName}.log { - roll_size 100MiB - roll_keep 5 - roll_keep_for 100d - } + output stderr format json - level INFO + level DEBUG ''; } diff --git a/hosts/shared/promtail.nix b/hosts/shared/promtail.nix index 592ce54..63cdaf3 100644 --- a/hosts/shared/promtail.nix +++ b/hosts/shared/promtail.nix @@ -15,29 +15,6 @@ ]; positions = { filename = "/tmp/promtail-positions.yaml"; }; scrape_configs = [ - { - job_name = "caddy"; - static_configs = [ - { - targets = [ "localhost" ]; - labels = { - job = "caddy"; - "__path__" = "/var/log/caddy/*log"; - agent = "caddy-promtail"; - }; - } - ]; - pipeline_stages = [ - { - json = { - expressions = { duration = "duration"; status = "status"; }; - }; - } - { - labels = { duration = ""; status = ""; }; - } - ]; - } { job_name = "journal"; journal = {