Skip to main content

5 posts tagged with "logging"

logging tag description

View All Tags

Python Error Handling: try-except Blocks, Logging Levels, and Exception Patterns

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

Everything You Want to Know About Python Error Handling​

Effective error handling is the foundation of writing robust, maintainable, and reliable Python code. It ensures that your application can gracefully manage unexpected conditions without crashing, providing clean feedback to the user or logging useful data for debugging.

This article details the comprehensive toolkit Python provides for managing errors, covering structure, best practices, and advanced techniques.

Python Exception Handling: Propagation, Hierarchy, and Tracebacks

· 8 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 propagation dynamics, the class inheritance hierarchy, multi-exception catch patterns, custom error design, 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: The Complete Guide from Basics to Metaprogramming

· 10 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 metaprogramming, data validation, serialization, and type checking. By utilizing custom properties and dunder methods (__new__, _missing_, __str__, __format__), you can embed complex business logic directly into your constant definitions.

This guide provides a comprehensive manual on Python Enums, covering basic conventions, conversions, reverse lookups, collections packaging, type hinting integration, custom string rendering, and advanced metaclass behavior.