cdddg / py-clean-arch

A Python implementation of Clean Architecture, inspired by Uncle Bob's book
76 stars 13 forks source link

Suggestions for py-clean-arch Structure and Logging Configuration #24

Closed cdddg closed 8 months ago

cdddg commented 1 year ago

Overview

As I delve deeper into py-clean-arch, I see potential refinements to align more closely with Clean Architecture principles, especially regarding logging and middleware. I'd like to share some insights and seek community feedback.

Proposed Directory Structure:

src/
├── frameworks/ or infra/
│   ├── logging/
│   │   ├── filters.py       - Log filters
│   │   ├── formatters.py    - Log formatters
│   │   └── config.py        - Log configurations
│   ├── middleware/
│   │   ├── request_parsing.py  - Request parsing middleware
│   │   └── exception_handling.py - Exception handling middleware
│   └── extension.py         - FastAPI extensions

Logging Configuration Dilemma

I'm suggesting having a logging_conf.yml for centralized logging configuration. However, intertwining this config with specific code modules poses a structural challenge. Thoughts or recommendations on this are welcome.

Feedback

I'd appreciate feedback on the above suggestions and any alternative ideas you might have.