-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backend Web App "uvicorn" logger not working #820
Comments
Python apps run on Azure App Service for Linux use a gunicorn WSGI by default. By default the logging and debugging arguments are not set in the terraform PubSec-Info-Assistant/infra/main.tf Line 90 in f295135
You can specify more commands in your app service where the gunicorn command is set and restart it. If you want to log them to a file you should use the access log command You also have the option to override this, if you wish to use uvicorn directly instead. |
Sorry if I am missing something but why does the uvicorn logger work for the enrichment app but not the backend web app? |
Is there a specific error or statement you are not seeing that you can point to? I also noticed the compare and directGPT approaches do not have a logging config set, which may be a reason if it is specific to logging those approaches as a global logging level is not specified with logging.basicConfig Logging is set at several different layers of the application, narrowing it down to a specific file or function would be helpful in debugging this. |
In the backend app.py you will see the log = logging.getLogger("uvicorn") as I pointed out above. The code was written to setLevel("DEBUG"). Any calls to log.debug("HELLO WORLD") fail to show any output in the log stream for the backend web app nor app insights. I used the out of the box deployment code. |
We have added this to the backlog and assigned an engineer to review. |
Discussed in #818
Originally posted by supplemarty August 15, 2024
The backend (and enrichment) web apps use the "uvicorn" logger as seen here:
log = logging.getLogger("uvicorn") log.setLevel('DEBUG') log.propagate = True
When I use this log variable in the backend code for debug tracing like:
log.debug("HELLO WORLD")
those log entries do not show up in the log stream NOR application insights but in the enrichment app this same pattern seems to be working fine.
I setup my own logger using the StreamHandler, and it works as I would expect. I cannot see where uvicorn is getting its logging dict configuration in the azure web app configuration. Thoughts?
The text was updated successfully, but these errors were encountered: