Spaces:
Paused
Paused
Commit
·
06e37d1
1
Parent(s):
1ea8628
Auto-commit: app.py updated
Browse files
app.py
CHANGED
|
@@ -15,16 +15,28 @@ from pathlib import Path
|
|
| 15 |
import logging
|
| 16 |
|
| 17 |
# Configure logging for Linux environment
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
)
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|