From 66397932cf88855e6ac967eb8c52965a104575a4 Mon Sep 17 00:00:00 2001 From: rogerogers Date: Mon, 10 Jun 2024 16:01:22 +0800 Subject: [PATCH] chore(gomall): update log config Signed-off-by: rogerogers --- gomall/deploy/config/promtail.yml | 8 ++++---- gomall/docker-compose.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gomall/deploy/config/promtail.yml b/gomall/deploy/config/promtail.yml index 5574bbf..91dc48a 100644 --- a/gomall/deploy/config/promtail.yml +++ b/gomall/deploy/config/promtail.yml @@ -7,10 +7,10 @@ positions: filename: /tmp/positions.yaml clients: - - url: http://localhost:3100/loki/api/v1/push + - url: http://loki:3100/loki/api/v1/push scrape_configs: - - job_name: kitex + - job_name: hertz pipeline_stages: - json: expressions: @@ -21,5 +21,5 @@ scrape_configs: - targets: - localhost labels: - job: demo_proto - __path__: demo/demo_proto/log/kitex.log + app: frontend + __path__: /logs/frontend/hertz.log \ No newline at end of file diff --git a/gomall/docker-compose.yaml b/gomall/docker-compose.yaml index 80f8033..0d27e33 100644 --- a/gomall/docker-compose.yaml +++ b/gomall/docker-compose.yaml @@ -55,3 +55,18 @@ services: - GF_AUTH_DISABLE_LOGIN_FORM=true ports: - "3000:3000" + + loki: + image: grafana/loki:2.9.2 + volumes: + - ./deploy/config/loki.yml:/etc/loki/local-config.yaml + command: -config.file=/etc/loki/local-config.yaml + ports: + - "3100:3100" + + promtail: + image: grafana/promtail:2.9.2 + volumes: + - ./deploy/config/promtail.yml:/etc/promtail/config.yml + - ./app/frontend/log:/logs/frontend + command: -config.file=/etc/promtail/config.yml