forked from MirrorHub/synapse
Logging improvements for the pusher (#4691)
This commit is contained in:
parent
c88bc53903
commit
b2200a8690
3 changed files with 15 additions and 13 deletions
1
changelog.d/4691.misc
Normal file
1
changelog.d/4691.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Improve the logging in the pusher process.
|
|
@ -333,10 +333,10 @@ class HttpPusher(object):
|
||||||
defer.returnValue([])
|
defer.returnValue([])
|
||||||
try:
|
try:
|
||||||
resp = yield self.http_client.post_json_get_json(self.url, notification_dict)
|
resp = yield self.http_client.post_json_get_json(self.url, notification_dict)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
logger.warn(
|
logger.warning(
|
||||||
"Failed to push event %s to %s",
|
"Failed to push event %s to %s: %s %s",
|
||||||
event.event_id, self.name, exc_info=True,
|
event.event_id, self.name, type(e), e,
|
||||||
)
|
)
|
||||||
defer.returnValue(False)
|
defer.returnValue(False)
|
||||||
rejected = []
|
rejected = []
|
||||||
|
@ -367,10 +367,10 @@ class HttpPusher(object):
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
resp = yield self.http_client.post_json_get_json(self.url, d)
|
resp = yield self.http_client.post_json_get_json(self.url, d)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
logger.warn(
|
logger.warning(
|
||||||
"Failed to send badge count to %s",
|
"Failed to send badge count to %s: %s %s",
|
||||||
self.name, exc_info=True,
|
self.name, type(e), e,
|
||||||
)
|
)
|
||||||
defer.returnValue(False)
|
defer.returnValue(False)
|
||||||
rejected = []
|
rejected = []
|
||||||
|
|
|
@ -52,11 +52,12 @@ class PusherFactory(object):
|
||||||
logger.info("defined email pusher type")
|
logger.info("defined email pusher type")
|
||||||
|
|
||||||
def create_pusher(self, pusherdict):
|
def create_pusher(self, pusherdict):
|
||||||
logger.info("trying to create_pusher for %r", pusherdict)
|
kind = pusherdict['kind']
|
||||||
|
f = self.pusher_types.get(kind, None)
|
||||||
if pusherdict['kind'] in self.pusher_types:
|
if not f:
|
||||||
logger.info("found pusher")
|
return None
|
||||||
return self.pusher_types[pusherdict['kind']](self.hs, pusherdict)
|
logger.info("creating %s pusher for %r", kind, pusherdict)
|
||||||
|
return f(self.hs, pusherdict)
|
||||||
|
|
||||||
def _create_email_pusher(self, _hs, pusherdict):
|
def _create_email_pusher(self, _hs, pusherdict):
|
||||||
app_name = self._app_name_from_pusherdict(pusherdict)
|
app_name = self._app_name_from_pusherdict(pusherdict)
|
||||||
|
|
Loading…
Reference in a new issue