Skip to main content

4 posts tagged with "logging"

logging tag description

View All Tags

Python Exception Handling: Complete Guide to try-except, Propagation, Hierarchy, and Tracebacks

· 12 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Writing robust, fault-tolerant software in Python requires a solid understanding of how errors propagate, how Python's built-in exceptions are structured, and how to capture context-rich debugging information when failures occur.

This guide provides a comprehensive manual on exception handling in Python, detailing block flow control (try, except, else, finally), stack unwinding dynamics, the class inheritance hierarchy, multi-exception catch patterns, custom error design, context managers, and production logging strategies for tracebacks.

Linking Logs Across Python Microservices(Distributed Tracing)

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Distributed Tracing: Linking Logs Across Python Microservices​

In modern microservices architectures, a single user request might flow through an API Gateway, an authentication service, a business logic service, and several data services. While structured logging makes each service's log output clean, it doesn't automatically connect the dots.

Distributed Tracing is the operational practice of adding unique identifiers to every log and header related to a single request, allowing you to reconstruct the entire request path across all services.

Python Logging: The Complete Guide from basicConfig to Structured JSON Observability

· 11 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Logs are a primary source of truth for application health, performance audits, and runtime debugging. However, outputting unstructured plain text console strings limits searchability and scalability. To build modern, observable applications, you need a robust logging hierarchy, log rotation schemes, centralized configurations, and structured output formats.

This guide provides a comprehensive manual on Python logging, covering basic setup parameters, log rotation, dict-based configurations, JSON-structured output, contextual metadata injection, and performance best practices.

Python Enums: Complete Developer Guide from Basics to Metaprogramming

· 8 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

In Python, the enum.Enum class is far more than a simple container for constants. It provides a robust, type-safe framework for data validation, serialization, metaprogramming, and static type checking.

Using Enums eliminates fragility across your codebase by replacing raw magic numbers and string literals with structured, immutable objects. By utilizing custom properties and dunder methods (__init__, __new__, _missing_, __str__, __format__), you can embed rich domain logic directly into your constant definitions.

This guide provides a comprehensive manual on Python Enums, covering core foundations, automatic values (auto()), uniqueness validation (@unique), primitive conversions, iteration, type hinting, JSON serialization, and advanced metaprogramming.