File tree Expand file tree Collapse file tree 1 file changed +44
-1
lines changed
Expand file tree Collapse file tree 1 file changed +44
-1
lines changed Original file line number Diff line number Diff line change 11import gunicorn
2- gunicorn .SERVER_SOFTWARE = 'Python'
2+
3+ # Can be resolved because of how Dockerfile organizes the code during build
4+ from config import JSON_LOGGER , CONSOLE_LOG_LEVEL , CONSOLE_LOG_FORMAT_JSON
5+
6+ gunicorn .SERVER_SOFTWARE = "Python"
7+
8+ if JSON_LOGGER :
9+ logconfig_dict = {
10+ "version" : 1 ,
11+ "disable_existing_loggers" : False ,
12+ "root" : {"level" : CONSOLE_LOG_LEVEL , "handlers" : []},
13+ "loggers" : {
14+ "gunicorn.error" : {
15+ "level" : CONSOLE_LOG_LEVEL ,
16+ "handlers" : ["error_console" ],
17+ "propagate" : True ,
18+ "qualname" : "gunicorn.error" ,
19+ },
20+ "gunicorn.access" : {
21+ "level" : CONSOLE_LOG_LEVEL ,
22+ "handlers" : ["console" ],
23+ "propagate" : True ,
24+ "qualname" : "gunicorn.access" ,
25+ },
26+ },
27+ "handlers" : {
28+ "console" : {
29+ "class" : "logging.StreamHandler" ,
30+ "formatter" : "json" ,
31+ "stream" : "ext://sys.stdout" ,
32+ },
33+ "error_console" : {
34+ "class" : "logging.StreamHandler" ,
35+ "formatter" : "json" ,
36+ "stream" : "ext://sys.stderr" ,
37+ },
38+ },
39+ "formatters" : {
40+ "json" : {
41+ "class" : "jsonformatter.JsonFormatter" ,
42+ "format" : CONSOLE_LOG_FORMAT_JSON ,
43+ },
44+ },
45+ }
You can’t perform that action at this time.
0 commit comments