Skip to content

docs(distributed): Document log server and crash-safe logger#435

Merged
kcenon merged 1 commit into
mainfrom
docs/issue-431-log-server-crash-safe-logger
Feb 9, 2026
Merged

docs(distributed): Document log server and crash-safe logger#435
kcenon merged 1 commit into
mainfrom
docs/issue-431-log-server-crash-safe-logger

Conversation

@kcenon

@kcenon kcenon commented Feb 9, 2026

Copy link
Copy Markdown
Owner

Summary

Adds comprehensive documentation for two advanced production logging features:

1. Log Server (server/log_server.h)

  • Centralized log collection server for distributed applications
  • Multi-threaded worker pool architecture
  • Configuration: host, port, max_connections, compression, encryption
  • Factory methods: create_basic(), create_default()
  • Deployment patterns: single server, multi-region, ELK integration

2. Crash-Safe Logger (safety/crash_safe_logger.h)

  • Signal handler-based emergency flush (SIGSEGV, SIGABRT, SIGTERM, SIGINT)
  • Async-signal-safe implementation (no allocations in handlers)
  • flush_with_timeout() for deadlock prevention
  • Auto-flush background thread for data durability
  • Atomic log level management

3. Combined Usage

  • Local crash safety + network forwarding topology
  • Server-side crash protection
  • Complete production deployment examples

Changes

  • Created: docs/LOG_SERVER_AND_CRASH_SAFETY.md (1,673 lines)
    • Architecture diagrams for both features
    • Full API reference with code examples
    • Crash safety mechanism explanation
    • Performance overhead benchmarks (2-10% vs standard logger)
    • Deployment topology examples
    • Best practices and troubleshooting guide

Related Issues

Closes #431

Part of: [EPIC] docs: Address documentation gaps across all ecosystem systems (kcenon/common_system#325)

Test Plan

  • Documentation builds without errors
  • All code examples compile and follow existing patterns
  • Cross-references to related docs verified (CONFIGURATION_STRATEGIES.md, WRITER_GUIDE.md, SECURITY_GUIDE.md)
  • API signatures match header files (log_server.h, crash_safe_logger.h)
  • Deployment examples validated against current architecture

Documentation Coverage

✅ Log server architecture with component diagram
✅ Log server API fully documented with examples
✅ Server configuration examples (basic, high-volume, secure)
✅ Crash-safe logger mechanism explained
✅ Crash-safe logger API documented with method details
✅ Recovery procedure documented
✅ Performance overhead analysis with benchmarks
✅ Deployment topology examples (3 patterns)
✅ Integration examples (Docker, programmatic control)
✅ Best practices section
✅ Troubleshooting guide

Reviewer Notes

Key sections to review:

  1. Architecture Diagrams (lines 25-73): Distributed logging topology
  2. Crash Safety Mechanism (lines 645-733): Signal handler flow and async-signal-safe constraints
  3. Performance Benchmarks (lines 987-1023): Overhead measurements
  4. Combined Topology (lines 1193-1293): Production deployment example
  5. Troubleshooting (lines 1409-1580): Common issues and solutions

All examples follow existing code patterns and are production-ready.

Add comprehensive documentation for advanced production logging features:

Log Server:
- Centralized log collection architecture
- server_config with compression/encryption flags
- Multi-threaded worker pool design
- Deployment patterns (single server, multi-region, ELK integration)
- Factory methods: create_basic(), create_default()
- Docker deployment examples

Crash-Safe Logger:
- Signal handler-based emergency flush (SIGSEGV, SIGABRT, SIGTERM, SIGINT)
- Async-signal-safe implementation (no allocations in handlers)
- flush_with_timeout() for deadlock prevention
- Auto-flush background thread for data durability
- Atomic log level management
- Performance overhead benchmarks: 2-10% vs standard logger

Combined Usage:
- Local crash safety + network forwarding topology
- Server-side crash protection
- Complete production deployment with multi-tier filtering

Addresses issue #431 acceptance criteria:
- Log server architecture with component diagram
- Full API reference with examples
- Crash safety mechanism explanation
- Recovery procedure documentation
- Performance overhead analysis
- Deployment topology examples

Closes #431
@kcenon kcenon merged commit 5096629 into main Feb 9, 2026
31 checks passed
@kcenon kcenon deleted the docs/issue-431-log-server-crash-safe-logger branch February 9, 2026 02:59
kcenon added a commit that referenced this pull request Apr 13, 2026
Add comprehensive documentation for advanced production logging features:

Log Server:
- Centralized log collection architecture
- server_config with compression/encryption flags
- Multi-threaded worker pool design
- Deployment patterns (single server, multi-region, ELK integration)
- Factory methods: create_basic(), create_default()
- Docker deployment examples

Crash-Safe Logger:
- Signal handler-based emergency flush (SIGSEGV, SIGABRT, SIGTERM, SIGINT)
- Async-signal-safe implementation (no allocations in handlers)
- flush_with_timeout() for deadlock prevention
- Auto-flush background thread for data durability
- Atomic log level management
- Performance overhead benchmarks: 2-10% vs standard logger

Combined Usage:
- Local crash safety + network forwarding topology
- Server-side crash protection
- Complete production deployment with multi-tier filtering

Addresses issue #431 acceptance criteria:
- Log server architecture with component diagram
- Full API reference with examples
- Crash safety mechanism explanation
- Recovery procedure documentation
- Performance overhead analysis
- Deployment topology examples

Closes #431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] docs: Document log server and crash-safe logger

1 participant