title: Design pattern for logging entry and exit of methods?
body: <p>I have an overall design and architecture question. After looking at design patterns (decorators, chain of commands, and so on) it is still unclear to me.</p>
  <p>Requirement:
  I would like to have logging for both entry and exit of my methods.</p>
  <p>As of now, all my methods looks like:</p>
  <pre><code>public SomeReturnType someMethod1( SomeParameter someParameter ) {
      LOGGER.info( &quot;{someMethod1}[START someMethod1 compute]&quot; );
  
      doSomeComputationFor(someParameter);
      SomeReturnType result = getSomeResult();
  
      LOGGER.info( &quot;{someMethod1}[END someMethod1 compute]&quot; );
  
      return result;
  }
  
  public SomeOtherReturnType someMethod2( SomeOtherParameter someOtherParameter ) {
      LOGGER.info( &quot;{someMethod2}[START someMethod2 compute]&quot; );
  
      maybeDoSomeDBOperation(someOtherParameter);
      SomeOtherReturnType result = getSomeOtherResult();
  
      LOGGER.info( &quot;{someMethod2}[END someMethod2 compute]&quot; );
  
      return result;
  }
  </code></pre>
  <p>(Below the logging, I am also using some KPI library to send some timestamp, like StatsD)</p>
  <p>All structures are really of the form:</p>
  <pre><code>public Foo method( Bar bar ) {
      //1 do some logging as the method starts, and also send some KPI
      LOGGER.info( &quot;{method}[START method compute]&quot; );
  
      //2 do some computation and actual business logic
  
      //3 do some logging the confirm the mothods has reached the end + send some other KPI like time elapsed
      LOGGER.info( &quot;{method}[END method compute]&quot; );
  
      return result;
  }
  </code></pre>
  <p>Now, looking at my project, I have some 290 methods who are following the EXACT same structure.</p>
  <p>Is there a clever way of resolving this? Maybe with a nice pattern? Some annotations? Aspects? I am open to suggestion as I believe there is definitely a better solution than my current one.</p>