richcolorlog Logo

User Guide

  • Installation
    • Requirements
    • Basic Installation
    • Optional Dependencies
      • RabbitMQ Support
      • Kafka Support
      • ZeroMQ Support
      • Database Support
      • All Optional Dependencies
    • Verifying Installation
    • Development Installation
  • Quickstart
    • Basic Setup
    • Named Loggers
    • Custom Log Levels
    • Configuring Appearance
    • File Logging
    • Syntax Highlighting
    • Using with ANSI (No Rich)
    • Simple Logger for IPython/Jupyter
    • Complete Example
    • Next Steps
  • Configuration
    • setup_logging() Parameters
      • Basic Parameters
      • Display Options
      • Format Options
      • Syntax Highlighting
      • Custom Colors
    • Format Templates
      • Available Placeholders
      • Example Templates
    • Environment Variables
    • Configuration Examples
      • Development Configuration
      • Production Configuration
      • Minimal Configuration
  • Custom Log Levels
    • Level Hierarchy
    • Using Custom Levels
    • Level Constants
    • Syslog Severity Mapping
    • Filtering by Level
      • Per-Handler Levels
    • Level-Based Table Names (Database)
    • Icon Customization
    • Best Practices
  • Color Modes
    • Color Support Detection
    • Color Support Levels
    • Detection Logic
    • Forcing Color Mode
    • Color Schemes
      • TrueColor (24-bit)
      • 256 Color Mode
      • Basic (8/16 Colors)
      • Rich Color Format
    • Default Color Palette
      • With Background
      • Without Background
    • Custom Colors
    • Windows Support
    • Testing Color Support

Handlers

  • Console Handler
    • RichColorLogHandler
      • Basic Usage
      • Features
      • Configuration
    • AnsiLogHandler
      • When to Use
      • Usage
      • Format Template
    • Handler Parameters
      • RichColorLogHandler-Specific
    • Creating Custom Console Handler
    • Multiple Console Handlers
    • IPython/Jupyter Support
    • Performance Considerations
  • File Handler
    • Basic File Logging
    • Automatic Filename
    • Level-Based Formatting
    • File Handler Configuration
    • Example Configurations
      • Development
      • Production
      • Separate Files by Level
    • Rotating File Handler
    • Custom File Formatter
    • File Encoding
    • Best Practices
  • RabbitMQ Handler
    • Installation
    • Basic Usage
    • Configuration Parameters
    • Message Format
    • Routing Keys
    • Consumer Example
    • Exchange Configuration
    • Production Configuration
    • Error Handling
    • Direct Handler Usage
    • Cleanup
  • Kafka Handler
    • Installation
    • Basic Usage
    • Configuration Parameters
    • Topic Naming
      • Single Topic
      • Level-Based Topics
    • Message Format
    • Consumer Example
    • Multi-Broker Setup
    • Production Configuration
    • Integration with ELK Stack
    • Direct Handler Usage
    • Cleanup
  • ZeroMQ Handler
    • Installation
    • Basic Usage
    • Configuration Parameters
    • Socket Types
      • PUB Socket (Default)
      • PUSH Socket
    • Message Format
    • Subscriber Example
      • PUB/SUB Pattern
      • PUSH/PULL Pattern
    • Multi-Subscriber Architecture
    • Proxy/Forwarder
    • Production Configuration
    • Performance Considerations
    • Direct Handler Usage
    • Cleanup
  • Syslog Handler
    • Basic Usage
    • Configuration Parameters
    • Severity Mapping
    • Syslog Facilities
    • Message Format
    • Local Syslog (Unix Socket)
    • Remote Syslog Server
    • rsyslog Configuration
    • systemd-journald
    • Production Configuration
    • Viewing Syslog
    • Direct Handler Usage
  • Database Handler
    • Installation
    • Basic Usage
    • Configuration Parameters
    • Database-Specific Examples
      • PostgreSQL
      • MySQL
      • MariaDB
      • SQLite
    • Table Schema
    • Level-Based Tables
    • Querying Logs
    • Database Setup
      • PostgreSQL
      • MySQL
    • Production Configuration
    • Connection Pooling
    • Indexing
    • Cleanup/Retention
    • Direct Handler Usage
    • Cleanup

Advanced

  • Formatters
    • CustomFormatter (ANSI)
    • CustomRichFormatter
    • RichColorLogFormatter
    • LevelBasedFileFormatter
    • Creating Custom Formatters
    • Using Custom Formatters
    • Format String Reference
  • Filters
    • IconFilter
      • Usage with Handler
    • Creating Custom Filters
      • Level Filter
      • Module Filter
      • Message Filter
      • Rate Limit Filter
      • Context Filter
      • Sampling Filter
      • Sensitive Data Filter
    • Combining Filters
    • Filter Placement
  • Syntax Highlighting
    • Requirements
    • Basic Usage
      • Global Lexer
      • Per-Message Lexer
    • Available Lexers
    • Themes
    • Rich Handler Highlighting
    • ANSI Handler Highlighting
    • Auto-Detection
    • Logging Decorated Code
    • Logging Data Structures
    • Performance Considerations
  • Performance
    • Performance Tracker
    • Performance Decorator
    • Optimization Tips
      • 1. Disable Unused Features
      • 2. Use Appropriate Handler
      • 3. Check Level Before Expensive Operations
      • 4. Use Lazy Formatting
      • 5. Batch Logging
      • 6. Async Logging
      • 7. Memory Handler for Buffering
    • Benchmarking
    • Disabling Logging
    • Production Recommendations
    • Memory Usage

API Reference

  • Logger API
    • setup_logging
      • setup_logging()
    • setup_logging_custom
      • setup_logging_custom()
    • getLogger
      • getLogger()
    • getLoggerSimple
      • getLoggerSimple()
    • get_def
      • get_def()
    • CustomLogger
      • CustomLogger
        • CustomLogger.debug()
        • CustomLogger.info()
        • CustomLogger.notice()
        • CustomLogger.warning()
        • CustomLogger.error()
        • CustomLogger.critical()
        • CustomLogger.fatal()
        • CustomLogger.alert()
        • CustomLogger.emergency()
    • Level Constants
      • DEBUG_LEVEL
      • INFO_LEVEL
      • NOTICE_LEVEL
      • WARNING_LEVEL
      • ERROR_LEVEL
      • CRITICAL_LEVEL
      • FATAL_LEVEL
      • ALERT_LEVEL
      • EMERGENCY_LEVEL
  • Handlers API
    • RichColorLogHandler
      • RichColorLogHandler
    • AnsiLogHandler
      • AnsiLogHandler
    • RabbitMQHandler
      • RabbitMQHandler
        • RabbitMQHandler.emit()
        • RabbitMQHandler.close()
    • KafkaHandler
      • KafkaHandler
        • KafkaHandler.emit()
        • KafkaHandler.close()
    • ZeroMQHandler
      • ZeroMQHandler
        • ZeroMQHandler.emit()
        • ZeroMQHandler.close()
    • SyslogHandler
      • SyslogHandler
    • DatabaseHandler
      • DatabaseHandler
        • DatabaseHandler.emit()
        • DatabaseHandler.close()
  • Formatters API
    • CustomFormatter
      • CustomFormatter
        • CustomFormatter.format()
    • CustomRichFormatter
      • CustomRichFormatter
        • CustomRichFormatter.LEVEL_STYLES
        • CustomRichFormatter.format()
    • RichColorLogFormatter
      • RichColorLogFormatter
    • LevelBasedFileFormatter
      • LevelBasedFileFormatter
        • LevelBasedFileFormatter.info_format
        • LevelBasedFileFormatter.debug_format
        • LevelBasedFileFormatter.format()
    • Formatter Color Attributes
  • Colors API
    • ColorSupport
      • ColorSupport
        • ColorSupport.TRUECOLOR
        • ColorSupport.COLOR_256
        • ColorSupport.BASIC
        • ColorSupport.NONE
    • Check
      • Check
        • Check.enable_windows_ansi()
        • Check.detect_color_support()
    • Colors
      • Colors
        • Colors.check()
        • Colors.rich_color()
    • SafeDict
      • SafeDict
        • SafeDict.__missing__()
    • Default Color Schemes
      • TrueColor with Background
      • TrueColor Foreground Only
      • ANSI Escape Codes
  • Utilities API
    • Icon
      • Icon
        • Icon.debug
        • Icon.info
        • Icon.notice
        • Icon.warning
        • Icon.error
        • Icon.critical
        • Icon.alert
        • Icon.emergency
        • Icon.fatal
    • IconFilter
      • IconFilter
        • IconFilter.filter()
    • PerformanceTracker
      • PerformanceTracker
        • PerformanceTracker.record()
        • PerformanceTracker.get_stats()
    • performance_monitor
      • performance_monitor()
    • Syslog Mappings
      • SYSLOG_SEVERITY_MAP
      • LEVEL_TO_TABLE
      • LOGGING_LEVELS_LIST
    • IPython Utilities
      • _is_ipython()
      • _configure_ipython_logging()
      • suppress_async_warning()
    • Environment Checking
      • _check_logging_disabled()
    • Test Functions
      • test()
      • test_brokers()
      • test_lexer()
      • run_test()

Development

  • Changelog
    • [Unreleased]
    • [1.0.0] - 2025-10-02
      • Added
      • Documentation
    • [0.9.0] - 2025-09-15
      • Added
      • Fixed
    • [0.8.0] - 2025-09-01
      • Added
    • Known Issues
    • Roadmap
  • Contributing
    • Getting Started
    • Development Setup
    • Running Tests
    • Code Style
    • Making Changes
    • Commit Messages
    • Pull Request Guidelines
    • Reporting Issues
    • Documentation
    • Adding New Features
    • Code of Conduct
    • Questions?
    • License
  • License
    • MIT License
    • Third-Party Licenses
      • Rich
      • Pygments
      • pika (RabbitMQ)
      • kafka-python
      • pyzmq (ZeroMQ)
      • psycopg2 (PostgreSQL)
      • mysql-connector-python
richcolorlog
  • Search


© Copyright 2026, Hadi Cahyadi.

Built with Sphinx using a theme provided by Read the Docs.