Skip to content

Commit

Permalink
Merge pull request #2459 from mitre/websockets-logging
Browse files Browse the repository at this point in the history
Suppress websockets logging
  • Loading branch information
wbooth authored Jan 31, 2022
2 parents 355702f + 2739141 commit 261cb55
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/contacts/contact_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ async def start(self):
web_socket = self.get_config('app.contact.websocket')
try:
async with websockets.serve(self.handler.handle, *web_socket.split(':')):
# as soon as we start serving from websockets, we need to suppress their excessive debug messages
self.log.manager.loggerDict['websockets.protocol'].level = 100
self.log.manager.loggerDict['websockets.server'].level = 100

await self.stop_future
# as soon as we start serving from websockets, we need to suppress their excessive debug messages
self.log.manager.loggerDict['websockets.protocol'].level = 100
self.log.manager.loggerDict['websockets.server'].level = 100

except OSError as e:
self.log.error("WebSocket error: {}".format(e))

Expand Down

0 comments on commit 261cb55

Please sign in to comment.