Basically, I have a web service that I am trying to include in the log. To do this, I created a class with a logging method. I set the class in the service and then call the logging method in each of the web methods.
I am trying to find a way to get the name of the method that called the loggong method
Public sub tstmethod log_object.log_method end sub
in this case, the return name I'm looking for is "tstmethod"
Everywhere I saw said to use
Dim stackframe As New Diagnostics.StackFrame Return stackframe.GetMethod.Name.ToString
Or use
Dim stackframe As New Diagnostics.StackFrame Return stackframe.GetMethod.DeclaringType.FullName
which I call inside the logging method
getmethod.name.tostring returns the name of the logging method
getmethod.declaringtype.fullname returns the name of the logging class
no matter what i do, i can't find a way to get the name of the method that called the logging method in this case "tstmethod"
source share