mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-24 06:14:18 +01:00
Merge pull request #4716 from matrix-org/erikj/pusher_logging
Fix up pusher logging a bit
This commit is contained in:
commit
d14e94bae4
4 changed files with 17 additions and 1 deletions
1
changelog.d/4716.misc
Normal file
1
changelog.d/4716.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Reduce pusher logging on startup
|
|
@ -97,6 +97,11 @@ class HttpPusher(object):
|
||||||
pusherdict['pushkey'],
|
pusherdict['pushkey'],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.data is None:
|
||||||
|
raise PusherConfigException(
|
||||||
|
"data can not be null for HTTP pusher"
|
||||||
|
)
|
||||||
|
|
||||||
if 'url' not in self.data:
|
if 'url' not in self.data:
|
||||||
raise PusherConfigException(
|
raise PusherConfigException(
|
||||||
"'url' required in data for HTTP pusher"
|
"'url' required in data for HTTP pusher"
|
||||||
|
|
|
@ -56,7 +56,7 @@ class PusherFactory(object):
|
||||||
f = self.pusher_types.get(kind, None)
|
f = self.pusher_types.get(kind, None)
|
||||||
if not f:
|
if not f:
|
||||||
return None
|
return None
|
||||||
logger.info("creating %s pusher for %r", kind, pusherdict)
|
logger.debug("creating %s pusher for %r", kind, pusherdict)
|
||||||
return f(self.hs, pusherdict)
|
return f(self.hs, pusherdict)
|
||||||
|
|
||||||
def _create_email_pusher(self, _hs, pusherdict):
|
def _create_email_pusher(self, _hs, pusherdict):
|
||||||
|
|
|
@ -19,6 +19,7 @@ import logging
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.metrics.background_process_metrics import run_as_background_process
|
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||||
|
from synapse.push import PusherConfigException
|
||||||
from synapse.push.pusher import PusherFactory
|
from synapse.push.pusher import PusherFactory
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -222,6 +223,15 @@ class PusherPool:
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
p = self.pusher_factory.create_pusher(pusherdict)
|
p = self.pusher_factory.create_pusher(pusherdict)
|
||||||
|
except PusherConfigException as e:
|
||||||
|
logger.warning(
|
||||||
|
"Pusher incorrectly configured user=%s, appid=%s, pushkey=%s: %s",
|
||||||
|
pusherdict.get('user_name'),
|
||||||
|
pusherdict.get('app_id'),
|
||||||
|
pusherdict.get('pushkey'),
|
||||||
|
e,
|
||||||
|
)
|
||||||
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("Couldn't start a pusher: caught Exception")
|
logger.exception("Couldn't start a pusher: caught Exception")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue