Best of LoggingSeptember 2024

  1. 1
    Article
    Avatar of last9Last9·2y

    Golang Logging: A Comprehensive Guide for Developers

    Logging in Go is essential for debugging and maintaining application performance. While the standard log package offers basic functionality, third-party libraries like Zerolog and Zap provide advanced features like structured logging and configurable log levels. Implementing best practices, such as avoiding sensitive data in logs and using context-rich messages, can significantly enhance log analysis and troubleshooting. Integrating with observability platforms like ELK can further improve monitoring capabilities in production environments.

  2. 2
    Article
    Avatar of communityCommunity Picks·2y

    A channel-based ring buffer in Go

    The post shares a channel-based ring buffer implementation in Go, designed for the Loggregator server in CloudFoundry. It explains how to handle congestion in message distribution using buffered channels and goroutines to ensure fair log management without blocking the main processing loop. The provided solution replaces slower consumers' oldest messages without causing blockages and compares it with other classic ring buffer implementations that involve locking.

  3. 3
    Article
    Avatar of planetgolangPlanet Golang·2y

    An Ode to Logging

    Effective logging is crucial for software development, helping identify errors and streamline debugging. Use proper loggers instead of print statements in production, distinguish log levels (Info, Error, Warn, Trace), and ensure logs are both human and machine-readable with structured formats like JSON. Group events with Spans to build Traces and always centralize logs with a retention policy to avoid hefty cloud bills.

  4. 4
    Article
    Avatar of cerbosCerbos·2y

    Cerbos Hub Audit Logs Live in Beta

    Cerbos Hub has introduced Audit Logs as a beta feature, offering deep visibility into authorization decisions made by Policy Decision Points (PDPs). This feature supports various backends for log storage and aggregation, including local, file, Kafka, and the new Hub backend. Audit Logs come in two types: access logs for standard API request monitoring, and decision logs detailing the context and decisions of the PDP. This addition aids developers, security engineers, and product managers in debugging, security monitoring, and enhancing user experience.

  5. 5
    Article
    Avatar of communityCommunity Picks·2y

    How single message broke all our monitoring and dashboards

    A developer describes a recent incident where a single log entry broke their monitoring and dashboards in Axiom. The problem was due to a string that could not be indexed as JSON, causing the virtual field to fail. The developer managed to identify and fix the issue by utilizing Axiom documentation to implement a more robust type-check using `gettype(parse_json(message)) == "dictionary"`.

  6. 6
    Article
    Avatar of last9Last9·2y

    OpenTelemetry Filelog Receiver: Collecting Logs from Kubernetes

    The OpenTelemetry filelog receiver is a valuable tool for log collection in Kubernetes environments. It reads log files and converts them into the OpenTelemetry log format. Setting it up involves deploying the OpenTelemetry Collector in the Kubernetes cluster, configuring it via a YAML file, and applying the configuration. Optimization tips include using batch processors and memory limiters, and troubleshooting advice covers common issues like missing logs and parsing errors. The receiver integrates well with the OpenTelemetry ecosystem and can handle various log sources, including syslog. Advanced parsing techniques and integration with backends like Last9 Levitate are also discussed.

  7. 7
    Article
    Avatar of itnextITNEXT·2y

    An Introduction to the OpenTelemetry Collector

    OpenTelemetry provides open standards for interoperable tools handling telemetry data. The OpenTelemetry Collector, a flexible and extensible deployable binary, acts as a universal translator and pipeline for gathering, processing, and forwarding metrics, traces, and logs. It supports various plugins and can be tailored to different environments, including custom distributions for specific use cases. Deployable on Kubernetes, it can gather telemetry cluster-wide, with specific plugins for Kubernetes entities. The post promises a hands-on tutorial on integrating Kubernetes Cluster Logging with ClickHouse and Grafana using OpenTelemetry.