Skip to content

Commit

Permalink
feat: Restore logging configuration in settings for improved debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedNassar7 committed Dec 17, 2024
1 parent 7abe0ee commit dd532f5
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions egypt_metro/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@

MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware", # Security middleware
"whitenoise.middleware.WhiteNoiseMiddleware", # WhiteNoise middleware
"django.contrib.sessions.middleware.SessionMiddleware", # Session middleware
"django.middleware.common.CommonMiddleware", # Common middleware
"django.middleware.csrf.CsrfViewMiddleware", # CSRF middleware
"django.contrib.auth.middleware.AuthenticationMiddleware", # Authentication middleware
"django.contrib.messages.middleware.MessageMiddleware", # Messages middleware
"django.middleware.clickjacking.XFrameOptionsMiddleware", # Clickjacking middleware
"corsheaders.middleware.CorsMiddleware", # CORS middleware
"whitenoise.middleware.WhiteNoiseMiddleware", # WhiteNoise middleware
"allauth.account.middleware.AccountMiddleware", # Account middleware
# "debug_toolbar.middleware.DebugToolbarMiddleware", # Debug toolbar middleware
]
Expand Down Expand Up @@ -204,40 +204,40 @@
"REFRESH_TOKEN_LIFETIME": timedelta(days=7), # Refresh token lifetime
}

# LOGGING = {
# "version": 1, # Log version
# "disable_existing_loggers": False, # Don't disable existing loggers
# "formatters": {
# "verbose": {
# "format": "{levelname} {asctime} {module} {message}", # Log format
# "style": "{", # Use {} for formatting
# },
# },
# "handlers": {
# "console": {
# "class": "logging.StreamHandler", # Log to console
# "formatter": "verbose", # Use the verbose formatter
# },
# "file": {
# "level": "DEBUG", # Log debug messages
# "class": "logging.FileHandler", # Log to file
# "filename": BASE_DIR / "logs/debug.log", # File where logs are saved
# "formatter": "verbose", # Use the verbose formatter
# },
# },
# "loggers": {
# "django": {
# "handlers": ["console", "file"], # Log to console and file
# "level": "INFO", # Log info messages
# "propagate": True,
# },
# "__main__": {
# "handlers": ["console", "file"], # Log to console and file
# "level": "DEBUG", # Log all messages
# "propagate": True,
# },
# },
# }
LOGGING = {
"version": 1, # Log version
"disable_existing_loggers": False, # Don't disable existing loggers
"formatters": {
"verbose": {
"format": "{levelname} {asctime} {module} {message}", # Log format
"style": "{", # Use {} for formatting
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler", # Log to console
"formatter": "verbose", # Use the verbose formatter
},
"file": {
"level": "DEBUG", # Log debug messages
"class": "logging.FileHandler", # Log to file
"filename": BASE_DIR / "logs/debug.log", # File where logs are saved
"formatter": "verbose", # Use the verbose formatter
},
},
"loggers": {
"django": {
"handlers": ["console", "file"], # Log to console and file
"level": "INFO", # Log info messages
"propagate": True,
},
"__main__": {
"handlers": ["console", "file"], # Log to console and file
"level": "DEBUG", # Log all messages
"propagate": True,
},
},
}

CACHES = {
"default": {
Expand Down

0 comments on commit dd532f5

Please sign in to comment.