Skip to content
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

WebSocketProtocol logged as error #568

Closed
Pyvonix opened this issue Feb 8, 2020 · 2 comments
Closed

WebSocketProtocol logged as error #568

Pyvonix opened this issue Feb 8, 2020 · 2 comments

Comments

@Pyvonix
Copy link

Pyvonix commented Feb 8, 2020

Context
I will link a previous issue containing many informations about the current problem. I thought the problem came from the process manager for redirecting errors but after reading the code of uvicorn I found the problem.

Behavior
When a WebSocket request is received (and accepted), the log is redirected in the stderr.log file...

INFO:     None - "WebSocket /ws/" [accepted]

After the response the supervisor team, I have search the logger used for websocket communication...

uvicorn/protocols/websockets/websockets_impl.py

class WebSocketProtocol(websockets.WebSocketServerProtocol):
    def __init__(self, config, server_state, _loop=None):
        ...
        self.logger = logging.getLogger("uvicorn.error")

Problem
Did you have a reason to use ("uvicorn.error") for WebSocket requests?
Why we can't use the logger for success requests like HTTP? Because it's seem unicorn correctly understand the communication and accept it, as specified in the log [accepted]. So is behavior completely break the logging system to manage errors...

@Pyvonix
Copy link
Author

Pyvonix commented Feb 9, 2020

Duplicate of #562 with complet context and observed behavior

@tomchristie
Copy link
Member

Closing in favour of #562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants