My Learning Journey
  • My Learning Journey
  • Timeline
    • 2024
      • August
        • August 08, 2024
        • August 09, 2024
        • August 10, 2024
        • August 11, 2024
        • August 12, 2024
        • August 19, 2024
      • November
        • November 26, 2024
      • December
        • December 13, 2024
        • December 21, 2024
Powered by GitBook
On this page
  • Things That I Discovered
  • 1. Logging in Caddy Server
  • 2. Getting Started with Grafana Loki & Promtail
  1. Timeline
  2. 2024
  3. August

August 19, 2024

PreviousAugust 12, 2024NextNovember

Last updated 5 months ago

Things That I Discovered

1. Logging in Caddy Server

  • It's been a long since I've run , but hardly used any logging, thought of exploring logs which is easy to setup.

  • Logging in Caddyfile:

    example.domain.com {
        reverse_proxy localhost:8080
        log {
            output file /var/log/caddy/example.domain.com-access.log
        }
    }
  • Reference:

  • To avoid repeating the same log block again, and we can use snippets instead.

  • Logging using Snippets in Caddyfile:

    (logging) {
        log {
            output file /var/log/{args[0]}-access.log
        }
    }
    example.domain.com {
        reverse_proxy localhost:8080
        import logging example.domain.com
    }
  • Reference:

2. Getting Started with Grafana Loki & Promtail

  • Grafana Loki: A horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus.

  • Promtail: An agent that ships the contents of local logs to a private Loki instance, scraping logs and labeling them for efficient querying.

  • This setup will significantly improve my ability to monitor and analyze logs from various servers in a centralized and organized manner.

Today I explored and as part of my effort to streamline log access from my remote servers.

Caddy Server
Log Caddyfile Directive - Caddy Server Documentation
Snippets Caddyfile Directive - Caddy Server Documentation
Grafana Loki
Promtail