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/
21
21
dist /
22
22
downloads /
23
23
eggs /
24
- logs /
24
+ api / logs /
25
25
.eggs /
26
26
lib /
27
27
lib64 /
Original file line number Diff line number Diff line change 2
2
import os
3
3
from pathlib import Path
4
4
5
+ class IgnoreLogChangeDetectedFilter (logging .Filter ):
6
+ def filter (self , record : logging .LogRecord ):
7
+ return "Detected file change in" not in record .getMessage ()
5
8
6
9
def setup_logging (format : str = None ):
7
10
"""
@@ -10,8 +13,7 @@ def setup_logging(format: str = None):
10
13
Ensures log directory exists, and configures both file and console handlers.
11
14
"""
12
15
# 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
15
17
log_dir = base_dir / "logs"
16
18
log_dir .mkdir (parents = True , exist_ok = True )
17
19
default_log_file = log_dir / "application.log"
@@ -42,6 +44,10 @@ def setup_logging(format: str = None):
42
44
],
43
45
force = True
44
46
)
47
+
48
+ # Ignore log file's change detection
49
+ for handler in logging .getLogger ().handlers :
50
+ handler .addFilter (IgnoreLogChangeDetectedFilter ())
45
51
46
52
# Initial debug message to confirm configuration
47
53
logger = logging .getLogger (__name__ )
Original file line number Diff line number Diff line change 53
53
"api.api:app" ,
54
54
host = "0.0.0.0" ,
55
55
port = port ,
56
- reload = is_development ,
57
- reload_dirs = ["api" ] if is_development else None
56
+ reload = is_development
58
57
)
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ services:
15
15
- NODE_ENV=production
16
16
- SERVER_BASE_URL=http://localhost:${PORT:-8001}
17
17
- 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}
19
19
volumes :
20
20
- ~/.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
22
22
# Resource limits for docker-compose up (not Swarm mode)
23
23
mem_limit : 6g
24
24
mem_reservation : 2g
You can’t perform that action at this time.
0 commit comments