Amélioration de la gestion des logs
This commit is contained in:
		@@ -12,5 +12,5 @@ else
 | 
			
		||||
    python manage.py migrate --noinput
 | 
			
		||||
    python manage.py collectstatic --noinput
 | 
			
		||||
    python manage.py compilemessages
 | 
			
		||||
    gunicorn "$APP_NAME".wsgi:application --bind "$APP_HOST":"$APP_PORT" --workers 3 --log-level=info
 | 
			
		||||
    gunicorn "$APP_NAME".wsgi:application --bind "$APP_HOST":"$APP_PORT" --workers 5 --log-level=info
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
@@ -40,4 +40,6 @@ http {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    access_log  /var/log/nginx/access.log;
 | 
			
		||||
    error_log   /var/log/nginx/error.log warn;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -75,6 +75,7 @@ services:
 | 
			
		||||
      - ./deployment/scripts/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
 | 
			
		||||
      - static_files:/usr/src/app/static
 | 
			
		||||
      - media_files:/usr/src/app/media
 | 
			
		||||
      - log_files:/var/log/nginx
 | 
			
		||||
    env_file: .env.prod
 | 
			
		||||
    ports:
 | 
			
		||||
      - 6380:80
 | 
			
		||||
@@ -86,3 +87,4 @@ volumes:
 | 
			
		||||
  media_files:
 | 
			
		||||
  postgres_data_dir:
 | 
			
		||||
  redis_data:
 | 
			
		||||
  log_files:
 | 
			
		||||
 
 | 
			
		||||
@@ -297,9 +297,11 @@ LOGGING = {
 | 
			
		||||
    "disable_existing_loggers": False,
 | 
			
		||||
    "handlers": {
 | 
			
		||||
        "file": {
 | 
			
		||||
            "class": "logging.handlers.RotatingFileHandler",
 | 
			
		||||
            "level": level_debug,
 | 
			
		||||
            "class": "logging.FileHandler",
 | 
			
		||||
            "filename": "backend.log",
 | 
			
		||||
            "maxBytes": 5 * 1024 * 1024,  # 5 MB
 | 
			
		||||
            "backupCount": 5,  # keep last 5 files
 | 
			
		||||
        },
 | 
			
		||||
        "mail_admins": {
 | 
			
		||||
            "level": "ERROR",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user