Adding per-request information in logs
Summary
Currently, userLogger messages are too limited:
A message such as
User dwho successfully authenticated at level 2
Or
Invalid TOTP for dwho
Does not show any context information (IP address, etc.)
And users cannot implement their own logger class to fix it, because information is never transmitted to the userLogger class in the first place:
# $req is not transmitted
$class->userLogger->error('Bad service token');
Design proposition
I think userLogger (and maybe logger?) should be a member of the request object, so that its implementation can access all requests fields (Ip, web browser, country, whatToTrace, etc.), allowing users to customize their log messages better.
example: adding $whatToTrace + $ipAddr to all userLogger messages
@guimard do you see another way to do this in 2.0.x ?