sksameermujahid commited on
Commit
cf62e23
·
verified ·
1 Parent(s): 68b5c9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -32,11 +32,15 @@ app = Flask(__name__)
32
  CORS(app) # Enable CORS for frontend
33
 
34
  # Configure logging
 
 
 
 
35
  logging.basicConfig(
36
  level=logging.INFO,
37
  format='%(asctime)s - %(levelname)s - %(message)s',
38
  handlers=[
39
- logging.FileHandler('app.log'),
40
  logging.StreamHandler()
41
  ]
42
  )
 
32
  CORS(app) # Enable CORS for frontend
33
 
34
  # Configure logging
35
+ log_dir = os.environ.get('LOG_DIR', '/app/logs')
36
+ os.makedirs(log_dir, exist_ok=True)
37
+ log_file = os.path.join(log_dir, 'app.log')
38
+
39
  logging.basicConfig(
40
  level=logging.INFO,
41
  format='%(asctime)s - %(levelname)s - %(message)s',
42
  handlers=[
43
+ logging.FileHandler(log_file),
44
  logging.StreamHandler()
45
  ]
46
  )