-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed to json config file for logging and background async task now…
… closes within the lifetime of app
- Loading branch information
1 parent
e847a9c
commit 4155893
Showing
4 changed files
with
55 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"version": 1, | ||
"disable_existing_loggers": false, | ||
"formatters": { | ||
"default": { | ||
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s" | ||
}, | ||
"access": { | ||
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s" | ||
} | ||
}, | ||
"handlers": { | ||
"default": { | ||
"formatter": "default", | ||
"class": "logging.StreamHandler", | ||
"stream": "ext://sys.stderr" | ||
}, | ||
"access": { | ||
"formatter": "access", | ||
"class": "logging.StreamHandler", | ||
"stream": "ext://sys.stdout" | ||
} | ||
}, | ||
"loggers": { | ||
"uvicorn.error": { | ||
"level": "INFO", | ||
"handlers": ["default"], | ||
"propagate": false | ||
}, | ||
"uvicorn.access": { | ||
"level": "INFO", | ||
"handlers": ["access"], | ||
"propagate": false | ||
} | ||
}, | ||
"root": { | ||
"level": "DEBUG", | ||
"handlers": ["default"], | ||
"propagate": false | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import uvicorn | ||
|
||
from api.main import app | ||
|
||
|
||
def main(): | ||
log_config_file = "log_config.json" | ||
uvicorn.run(app, log_config=log_config_file) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |