I’m using log4net for logging whenever i tried to print a exception message using the log.Error(). i’m getting a new line in the log file.I want to avoid this. can anyone help me out here.
I’m using log4net for logging whenever i tried to print a exception message using
Share
One way to avoid this is to tell the appender not to log the stack trace:
Log4Net – Logging out the Exception stacktrace only for certain files
If you need the stack trace in your log file you can combine the solution above with an additional pattern converter that is responsible to write the stack trace without creating new lines. A sample converter can be found here:
how to convert my decimal thread ID to hex and make it appear in hex format in log4net conversion pattern?