Add scope to email logging.
Add scopes to `Object::log()` signature.
Refactor code to not use extract()/compact()
Merge branch 'email-scope' into 2.4

Merge of GH-1137 into 2.4