how to override error method in c# log4net -
i ask if possible override log methods or create new 1 properties in method.
at moment can use it:
globalcontext.properites["details"] = "some info"; log.error("some info",exception);
i use it:
log.myspecialerror(details, message, exception);
any advice appreciated
ori
create own extension method.
it must defined in static class, , static method. e.g.
definitions:
public static class log4netextensions { public static void myspecialerror(this log log, string details, string message, exception exception) { //do parameters } }
use:
log.myspecialerror(details, message, ex);
Comments
Post a Comment