I learned today that in .Net doing a ex.ToString() would log the complete exception details including any inner exception details. The important thing here is that it would do this recursively so if there is an InnerException it would call ToString() on it, which in turn can call ToString() on the next level hence forming a recursive chain.

So we can do away with such format string

System.Diagnostics.Trace.TraceError("The error was {0}. Stack Trace {1}. InnerException Details {2}",ex.Message, ex.StackTrace,ex.InnerException.Message);