Skip to content

Commit d555c9f

Browse files
authored
Merge pull request #230 from rragundez/logging
Add robust logging
2 parents 71e231e + 4fcaa8f commit d555c9f

16 files changed

Lines changed: 300 additions & 229 deletions

File tree

docs/user-guide/configuration/environment-variables.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -436,21 +436,6 @@ class SecurityHeadersMiddleware(BaseHTTPMiddleware):
436436

437437
## Logging Configuration
438438

439-
### Basic Logging Setup
440-
441-
Configure logging in `src/app/core/logger.py`:
442-
443-
```python
444-
import logging
445-
from logging.handlers import RotatingFileHandler
446-
447-
# Set log level
448-
LOGGING_LEVEL = logging.INFO
449-
450-
# Configure file rotation
451-
file_handler = RotatingFileHandler("logs/app.log", maxBytes=10485760, backupCount=5) # 10MB # Keep 5 backup files
452-
```
453-
454439
### Structured Logging
455440

456441
Use structured logging for better observability:
@@ -469,15 +454,6 @@ structlog.configure(
469454
)
470455
```
471456

472-
### Log Levels by Environment
473-
474-
```python
475-
# Environment-specific log levels
476-
LOG_LEVELS = {"local": logging.DEBUG, "staging": logging.INFO, "production": logging.WARNING}
477-
478-
LOGGING_LEVEL = LOG_LEVELS.get(settings.ENVIRONMENT, logging.INFO)
479-
```
480-
481457
## Environment-Specific Configurations
482458

483459
### Development (.env.development)

0 commit comments

Comments
 (0)