How to log stack trace with log4net
? I am using .Net
version.
They way I have is Log.Error(ex)
.
Thanks
You need to ensure that the definition of the layout pattern is structured to output what format and data you want.
log4Net Pattern Layout
Used to output the stack trace of the logging event The stack trace level specifier may be enclosed between braces. For example, %stacktrace{level}. If no stack trace level specifier is given then 1 is assumed
Output uses the format: type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1
This pattern is not available for Compact Framework assemblies.