HaochenGong commited on
Commit
9512c5f
·
1 Parent(s): b0a262d
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -27,8 +27,12 @@ log_directory = os.path.dirname(log_file_path)
27
  if not os.path.exists(log_directory):
28
  os.makedirs(log_directory)
29
 
30
- with open('/tmp/test_log.log', 'w') as f:
31
- f.write('Test log entry')
 
 
 
 
32
 
33
  # set log handler(Generate one log file per day and keep only the latest 7 files)
34
  handler = TimedRotatingFileHandler(log_file_path, when='W0', interval=1, backupCount=7)
 
27
  if not os.path.exists(log_directory):
28
  os.makedirs(log_directory)
29
 
30
+ try:
31
+ with open(log_file_path, 'w') as f:
32
+ f.write('Test log entry')
33
+ print(f"Successfully wrote to {log_file_path}")
34
+ except Exception as e:
35
+ print(f"Failed to write to {log_file_path}: {e}")
36
 
37
  # set log handler(Generate one log file per day and keep only the latest 7 files)
38
  handler = TimedRotatingFileHandler(log_file_path, when='W0', interval=1, backupCount=7)