This is my threadContext exception message property
log4net.ThreadContext.Properties["excmessage"] = ex.Message;
I want to get the first 10 characters of exception message property using log4net.
This is the line in Log4net.config:
%property{excmessage}
log4net.ThreadContext.Properties["excmessage"] = ex.Message.Substring(0,Math.Min(ex.Message.Length,10));
Wouldn't recommend it unless you have the full error message logged somewhere else. – Abeyta