Is there a possibility to log every call of methods (stack trace etc.) without adding code to this method. What I want is to check on which method application stuck, but I do not want to add log code to every method.
It stuck but doesn’t throw an error, so try catch with stack trace wouldn’t help.
It’s worth trying an AOP-based approach, such as PostSharp. You can use attributes on either classes or individual methods to control the logging.
For example, there’s a PostSharp plugin to integrate with log4net.