.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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -