Has anyone figured out how to log variable values with the logging functions. For example, I am trying to get user id printed in log.
$user_id=env\userAttribute('id');
$user_object=object\create();
object\set($user_object, 'USER_ID', $user_id);
log\warning('User: ',$user_object);
Manual says:
log\warning(MESSAGE, [CONTEXT])
Log a string MESSAGE with the WARNING level. An optional CONTEXT should be an object.
Thanks, Tim​
$user_id=env\userAttribute('id');
$user_object=object\create();
object\set($user_object, 'USER_ID', $user_id);
log\warning('User: ',$user_object);
Manual says:
log\warning(MESSAGE, [CONTEXT])
Log a string MESSAGE with the WARNING level. An optional CONTEXT should be an object.
Thanks, Tim​
Comment