title: Performance impact of logging using Spring AspectJ
body: <p>We are working on a web application where we are logging input and output of all the database calls in DAO classes. An example is:</p>
  
  <pre><code>@Override
  public List&lt;Long&gt; findUsers(final List&lt;Long&gt; userIds) {
      LOGGER.info("findUsers: finding user ids  by  followeeId {} ", userIds);
      ... // hibernate DB call
      LOGGER.info("findUsers: number of ids  founds are {}", userIdList.size());  
  </code></pre>
  
  <p>This code will be present inside all the DAO classes, and the number of such classes is around 100, and it may go higher.</p>
  
  <p>My question is shall we continue logging the info in the same way or shall we go for Spring-AspectJ implementation? -We'll have an aspect defined for <code>@Before</code> and <code>@After</code> for all such methods. This aspect will call logger and log the required info.</p>
  
  <p>Will implementing Spring-AspectJ be a performance hit? Any pointers are appreciated.</p>
  
  <p>I have gone through the below SO questions, but need some more clarity with respect to the example quoted above.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/433475/performance-impact-of-using-aop/433585#433585">Performance impact of using aop</a></li>
  <li><a href="https://stackoverflow.com/questions/433475/performance-impact-of-using-aop">Performance impact of using aop</a></li>
  </ul>