Note that there are some explanatory texts on larger screens.

plurals
  1. POlogging- changing implementation?
    primarykey
    data
    text
    <p>We have been using log4net for logging our asp.net web forms application. Our logging is typically in our business layer and the typical implementation is like this</p> <pre><code>SomeMethodCall(MethodParams) { Log.Start("Starting Some Method"); try { //do something } catch(Exception ex) { Log.Exception("exception in SomeMethodCall" + ex.message); } Log.End("End SomeMethod"); } </code></pre> <p>In my opinon, it is a bit clumsy. Is there a cleaner way of doing it without using AOP ?I am not sure if I would need to have the overhead of adding a framework, just for logging, thought I understand that it would give me a lot of other options (which I do not need)</p> <p>I am thinking of using some AOP frameworks to do it in a more cleaner way, just by marking the methods with attributes to log and handle exceptions.</p> <p>There are 2 things I am concerned with AOP (after my initial reading). </p> <p>Some frameworks inject code into your IL(as per my understanding) and am concerned if it would misguide me. I might be looking at line x, given by my AOP framework, where as it actually might be line y in my application. Is my fear unfounded?</p> <p>Performance: How much of a performance overhead would be added if using an AOP framework.</p> <p>Edit: I was also looking into <a href="http://www.davidhayden.com/blog/dave/archive/2007/03/03/PolicyInjectionApplicationBlockSample.aspx" rel="nofollow noreferrer">PolicyInjectionApplicationBlock</a>. Unfortunately, I do not have the luxury of changing implementaions inside my business logic</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload