Merge pull request #4716 from matrix-org/erikj/pusher_logging
Fix up pusher logging a bit
This commit is contained in:
commit
d14e94bae4
|
@ -0,0 +1 @@
|
|||
Reduce pusher logging on startup
|
|
@ -97,6 +97,11 @@ class HttpPusher(object):
|
|||
pusherdict['pushkey'],
|
||||
)
|
||||
|
||||
if self.data is None:
|
||||
raise PusherConfigException(
|
||||
"data can not be null for HTTP pusher"
|
||||
)
|
||||
|
||||
if 'url' not in self.data:
|
||||
raise PusherConfigException(
|
||||
"'url' required in data for HTTP pusher"
|
||||
|
|
|
@ -56,7 +56,7 @@ class PusherFactory(object):
|
|||
f = self.pusher_types.get(kind, None)
|
||||
if not f:
|
||||
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)
|
||||
|
||||
def _create_email_pusher(self, _hs, pusherdict):
|
||||
|
|
|
@ -19,6 +19,7 @@ import logging
|
|||
from twisted.internet import defer
|
||||
|
||||
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||
from synapse.push import PusherConfigException
|
||||
from synapse.push.pusher import PusherFactory
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -222,6 +223,15 @@ class PusherPool:
|
|||
"""
|
||||
try:
|
||||
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:
|
||||
logger.exception("Couldn't start a pusher: caught Exception")
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue