Stop uvicorn.run disabling existing loggers
This commit is contained in:
parent
26d488e75f
commit
dd0b30df51
1 changed files with 19 additions and 2 deletions
|
|
@ -30,7 +30,16 @@ def serve_from_cli(argv: Optional[list[str]] = None):
|
||||||
config = cli.config_from_args(args)
|
config = cli.config_from_args(args)
|
||||||
server = cli.server_from_config(config)
|
server = cli.server_from_config(config)
|
||||||
customise_server(server)
|
customise_server(server)
|
||||||
uvicorn.run(server.app, host=args.host, port=args.port)
|
uvicorn.run(
|
||||||
|
server.app,
|
||||||
|
host=args.host,
|
||||||
|
port=args.port,
|
||||||
|
log_config={
|
||||||
|
"version": 1,
|
||||||
|
"disable_existing_loggers": False,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
if args.fallback:
|
if args.fallback:
|
||||||
print(f"Error: {e}")
|
print(f"Error: {e}")
|
||||||
|
|
@ -40,6 +49,14 @@ def serve_from_cli(argv: Optional[list[str]] = None):
|
||||||
app.labthings_config = config
|
app.labthings_config = config
|
||||||
app.labthings_server = server
|
app.labthings_server = server
|
||||||
app.labthings_error = e
|
app.labthings_error = e
|
||||||
uvicorn.run(app, host=args.host, port=args.port)
|
uvicorn.run(
|
||||||
|
app,
|
||||||
|
host=args.host,
|
||||||
|
port=args.port,
|
||||||
|
log_config={
|
||||||
|
"version": 1,
|
||||||
|
"disable_existing_loggers": False,
|
||||||
|
},
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
raise e
|
raise e
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue