We have a service which will log unhandled exceptions at the app domain level (via Log4net).
We logged:
2014-01-28 16:49:19,636 ERROR [49] Fe
If you're receiving an exception but no corresponding stack trace then at some point an exception handler is probably evaluating the exception and re-throwing it incorrectly. For example, if you're doing a throw ex;
you'll eat the stack trace that led to that point. To preserve the existing call stack you want to simply throw;
Throwing exceptions best practices
Note that the C# way is the opposite of the convention for the Java language, where you are supposed to throw ex;
Java reference: Best Practice: Catching and re-throwing Java Exceptions
I prefer to manage my exceptions with custom exceptions, If in your case you are using your own exceptions you can go the the class were you define them and override the stacktrace. e.g:
public class YourCustomException: Exception
{
public YourCustomException() : base() { } //constructor
public override string StackTrace
{
get { return "Message instead stacktrace"; }
}
}