File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed
Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ develop-eggs/
2121dist /
2222downloads /
2323eggs /
24- logs /
24+ api / logs /
2525.eggs /
2626lib /
2727lib64 /
Original file line number Diff line number Diff line change 22import os
33from pathlib import Path
44
5+ class IgnoreLogChangeDetectedFilter (logging .Filter ):
6+ def filter (self , record : logging .LogRecord ):
7+ return "Detected file change in" not in record .getMessage ()
58
69def setup_logging (format : str = None ):
710 """
@@ -10,8 +13,7 @@ def setup_logging(format: str = None):
1013 Ensures log directory exists, and configures both file and console handlers.
1114 """
1215 # Determine log directory and default file path
13- # base_dir is now the workspace root
14- base_dir = Path (__file__ ).resolve ().parent .parent
16+ base_dir = Path (__file__ ).parent
1517 log_dir = base_dir / "logs"
1618 log_dir .mkdir (parents = True , exist_ok = True )
1719 default_log_file = log_dir / "application.log"
@@ -42,6 +44,10 @@ def setup_logging(format: str = None):
4244 ],
4345 force = True
4446 )
47+
48+ # Ignore log file's change detection
49+ for handler in logging .getLogger ().handlers :
50+ handler .addFilter (IgnoreLogChangeDetectedFilter ())
4551
4652 # Initial debug message to confirm configuration
4753 logger = logging .getLogger (__name__ )
Original file line number Diff line number Diff line change 5353 "api.api:app" ,
5454 host = "0.0.0.0" ,
5555 port = port ,
56- reload = is_development ,
57- reload_dirs = ["api" ] if is_development else None
56+ reload = is_development
5857 )
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ services:
1515 - NODE_ENV=production
1616 - SERVER_BASE_URL=http://localhost:${PORT:-8001}
1717 - LOG_LEVEL=${LOG_LEVEL:-INFO}
18- - LOG_FILE_PATH=${LOG_FILE_PATH:-logs/application.log}
18+ - LOG_FILE_PATH=${LOG_FILE_PATH:-api/ logs/application.log}
1919 volumes :
2020 - ~/.adalflow:/root/.adalflow # Persist repository and embedding data
21- - ./logs:/app/logs # Persist log files across container restarts
21+ - ./api/ logs:/app/api /logs # Persist log files across container restarts
2222 # Resource limits for docker-compose up (not Swarm mode)
2323 mem_limit : 6g
2424 mem_reservation : 2g
You can’t perform that action at this time.
0 commit comments