.net - Programmatically Logging Errors With Elmah : Logging specific information -
i logging error elmah inside try-catch block. here code;
try { datetime.parse("poo"); } catch (exception err) { elmah.errorsignal.fromcurrentcontext().raise(err); }
i log specific info information can retrieved previous methods or properties on same context exception properties readonly. best way that?
my main goal able below;
} catch (exception err) { err.message += "poo"; elmah.errorsignal.fromcurrentcontext().raise(err); }
you create own exception object , pass elmah.
setup static helper method , like
public static void handleerror(exception ex, string custommsg) { exception newex = new exception(custommsg, ex); elmah.errorsignal.fromcurrentcontext().raise(newex); }
Comments
Post a Comment