Best of LoggingDecember 2024

  1. 1
    Article
    Avatar of lobstersLobsters·1y

    I Almost Died for a Full Sentry Database

    A developer faced severe issues with a self-hosted Sentry instance that filled up rapidly, causing production apps to freeze due to blocking calls. Attempts to move Sentry to the cloud led to high costs and ultimately project failure due to mismanagement of error tracking and lack of proper alert monitoring.

  2. 2
    Article
    Avatar of last9Last9·1y

    systemctl logs: A Guide to Managing Logs in Linux

    Logs are essential for understanding and troubleshooting Linux systems. systemctl, a key tool for managing systemd services, interacts with journald to provide detailed logs. This guide covers how to view, filter, and manage these logs using common journalctl commands, as well as best practices for log rotation, cleanup, and monitoring. Understanding and using systemctl logs helps maintain system health, resolve service failures, and optimize performance.

  3. 3
    Article
    Avatar of trevorlasnTrevor Lasn·1y

    AsyncLocalStorage: Simplify Context Management in Node.js

    AsyncLocalStorage allows you to maintain context across async operations without manually passing data through functions. It's useful for tracking requests in microservices, logging, and managing database transactions. However, it's unnecessary for simple synchronous code and can add complexity when building public APIs. AsyncLocalStorage requires Node.js 23 or higher.

  4. 4
    Article
    Avatar of last9Last9·1y

    Python Logging with Structlog: A Comprehensive Guide

    Enhance your Python logging with structlog, a library that creates structured, readable, and machine-friendly logs. structlog helps in preserving context, improving readability and analysis, and providing customizable pipelines for log processing. It integrates easily with existing frameworks like Python's built-in logging module and supports high-throughput systems with features like asynchronous and buffered logging. structlog also works well with microservices architectures and observability tools, ensuring your logs are actionable and insightful.

  5. 5
    Article
    Avatar of lnLaravel News·1y

    Adding Request Context in Laravel Applications

    Learn how to use Laravel's Context facade to enhance application insight by adding persistent metadata to your requests. This guide provides code examples on implementing context in middleware and API request logging, which enriches logs with valuable debugging information.

  6. 6
    Article
    Avatar of last9Last9·1y

    Docker Compose Logs: An In-Depth Guide for Developers

    Docker Compose logs provide a unified view of logs from all services in a docker-compose.yml file, simplifying troubleshooting and monitoring. Users can view logs with the docker-compose logs command and utilize various options to filter and manage log output. Configuring logging drivers in the docker-compose.yml file allows routing logs to different destinations, and tools like Fluentd, Elasticsearch, and Grafana can be used for centralized logging and analysis. Log management practices such as log rotation and monitoring log volume are crucial for maintaining application performance.

  7. 7
    Article
    Avatar of baeldungBaeldung·1y

    How to Diagnose a Null Exception Message in Java

    Exceptions in Java can help find and fix bugs, but when an exception message is null, it can be confusing. This post examines why null exception messages occur, especially in Java versions prior to JDK 14, and how JDK 14 improves exception handling with detailed messages. It also provides tips on using stack traces and SLF4J for better debugging.

  8. 8
    Article
    Avatar of communityCommunity Picks·1y

    Configuring (and viewing!) logs in Laravel

    Laravel is a flexible, modern PHP framework with an advanced logging system. Learn about the basics of logging, including the logging.php configuration file, various logging channels, and how Laravel uses environment variables for easy management. The post covers simple file-based logging setups and advanced tools like Laravel Pail and Laravel Telescope for enhanced log viewing and debugging. It also touches on integrating external services like Sentry and Slack for robust error tracking in production and best practices for effective logging management.