Spaces:
Sleeping
Sleeping
Krishna Prakash
commited on
Commit
·
3acb78d
1
Parent(s):
cbb5839
Add custom logging to debug database loading issue
Browse files- Dockerfile +2 -2
- log_config.json +26 -0
Dockerfile
CHANGED
@@ -22,5 +22,5 @@ ENV HOME=/home/user \
|
|
22 |
# Expose port
|
23 |
EXPOSE 7860
|
24 |
|
25 |
-
# Command to run the app with debug logging
|
26 |
-
CMD ["
|
|
|
22 |
# Expose port
|
23 |
EXPOSE 7860
|
24 |
|
25 |
+
# Command to run the app with debug logging and custom log file
|
26 |
+
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port 7860 --log-level debug --log-config log_config.json"]
|
log_config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 1,
|
3 |
+
"disable_existing_loggers": false,
|
4 |
+
"handlers": {
|
5 |
+
"console": {
|
6 |
+
"class": "logging.StreamHandler",
|
7 |
+
"level": "DEBUG",
|
8 |
+
"formatter": "default"
|
9 |
+
},
|
10 |
+
"file": {
|
11 |
+
"class": "logging.FileHandler",
|
12 |
+
"level": "DEBUG",
|
13 |
+
"filename": "/home/user/app.log",
|
14 |
+
"formatter": "default"
|
15 |
+
}
|
16 |
+
},
|
17 |
+
"formatters": {
|
18 |
+
"default": {
|
19 |
+
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
20 |
+
}
|
21 |
+
},
|
22 |
+
"root": {
|
23 |
+
"level": "DEBUG",
|
24 |
+
"handlers": ["console", "file"]
|
25 |
+
}
|
26 |
+
}
|