There is a line of code $context['user'] = $this->currentUser;
inside of LoggerChannel::log() that was introduced as part of
#1289536: Switch Watchdog to a PSR-3 logging framework →
.
When the log message includes some type of wildcard referencing {user*}
, then \Drupal\Core\Logger\LogMessageParser::parseMessagePlaceholders() converts {users*} to @users* and then, because we have a context key 'user', it tries to put the AccountProxy object in there, which gives you this recoverable fatal error like: AccountProxy could not be converted to string
I tracked the code of the dblog
and syslog
and there is no use of the user object from the context array, just the uid
. This makes sense since the username of a user can change, the only thing that does not vary is the user id.
Please also credit to @penyaskito and @berdir in this issue.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.