Speedofmastery commited on
Commit
06e37d1
·
1 Parent(s): 1ea8628

Auto-commit: app.py updated

Browse files
Files changed (1) hide show
  1. app.py +21 -9
app.py CHANGED
@@ -15,16 +15,28 @@ from pathlib import Path
15
  import logging
16
 
17
  # Configure logging for Linux environment
18
- logging.basicConfig(
19
- level=logging.INFO,
20
- format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
21
- handlers=[
22
- logging.StreamHandler(sys.stdout),
23
- logging.FileHandler('/home/user/app/logs/openmanus.log', mode='a')
24
- ] if os.path.exists('/home/user/app/logs') else [logging.StreamHandler(sys.stdout)]
25
- )
26
- logger = logging.getLogger(__name__)
 
 
 
 
 
 
 
 
 
 
 
27
 
 
28
  logger.info("🐧 OpenManus Platform starting on Linux environment")
29
 
30
  # Cloudflare configuration
 
15
  import logging
16
 
17
  # Configure logging for Linux environment
18
+ try:
19
+ # Try to create logs directory if it doesn't exist
20
+ log_dir = Path('/home/user/app/logs')
21
+ log_dir.mkdir(parents=True, exist_ok=True)
22
+
23
+ logging.basicConfig(
24
+ level=logging.INFO,
25
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
26
+ handlers=[
27
+ logging.StreamHandler(sys.stdout),
28
+ logging.FileHandler('/home/user/app/logs/openmanus.log', mode='a')
29
+ ]
30
+ )
31
+ except Exception:
32
+ # Fallback to console-only logging
33
+ logging.basicConfig(
34
+ level=logging.INFO,
35
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
36
+ handlers=[logging.StreamHandler(sys.stdout)]
37
+ )
38
 
39
+ logger = logging.getLogger(__name__)
40
  logger.info("🐧 OpenManus Platform starting on Linux environment")
41
 
42
  # Cloudflare configuration