mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 17:05:01 -04:00
Record more information into structured logs. (#9654)
Records additional request information into the structured logs, e.g. the requester, IP address, etc.
This commit is contained in:
parent
0d87c6bd12
commit
48d44ab142
10 changed files with 255 additions and 88 deletions
|
@ -661,14 +661,13 @@ class CachedListDescriptorTestCase(unittest.TestCase):
|
|||
|
||||
@descriptors.cachedList("fn", "args1")
|
||||
async def list_fn(self, args1, arg2):
|
||||
assert current_context().request == "c1"
|
||||
assert current_context().name == "c1"
|
||||
# we want this to behave like an asynchronous function
|
||||
await run_on_reactor()
|
||||
assert current_context().request == "c1"
|
||||
assert current_context().name == "c1"
|
||||
return self.mock(args1, arg2)
|
||||
|
||||
with LoggingContext() as c1:
|
||||
c1.request = "c1"
|
||||
with LoggingContext("c1") as c1:
|
||||
obj = Cls()
|
||||
obj.mock.return_value = {10: "fish", 20: "chips"}
|
||||
d1 = obj.list_fn([10, 20], 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue