Logger is not able to access current user in some scenarios

While working on \include\SugarLogger\SugarLogger.php::log() function. I changed id to user_name.
But in many scenarios, it is not able to log user_name. I mean $GLOBALS[‘current_user’] is not accessible.
Is there any way using which I can achieve this?
I also tried with global $current_user but still no luck.

Hey there,

Have you found a solution for this, by chance?


I haven’t tried customizing the SugarLogger before, So i’m unfortunately not entirely sure what is/is not possible through it

It very well could be the case that no user is even getting passed through, for these scenarios?


Perhaps you could try getting the User from AJAX or js sides?

Some users here:

Have given examples of this


If you have any examples of what you are trying to achieve, or the code you have created, it would be good to see these
It might make it easier for anyone that comes across this post, with more knowledge, to assist!