That's exactly what I am doing...using OnInit method:

Method OnInit() As %Status

// Add info to the log.
$$$LOGINFO("Run by:"_$Username)
$$$LOGINFO(" > "_$SYSTEM.Process.UserName())

Nothing works...

Thank you but not sure about what you said.

I don't have a %request. It is just a Business Service doing nothing...and all I want is to get the username who enable it last time. Well, actually not last time. The service is normally off, so when is turned on, I want the username to be recorded in the log.

I have a function which actually run "write $USERNAME" and if I run it from Studio returns the username!

Antonio has no followers yet.
Antonio has not followed anybody yet.
Global Masters badges:
Antonio has no Global Masters badges yet.