Encapsulating logging and throwing exceptions into a method. Bad practice?
The second version removes some duplication, so it's better, but usually you should choose one of logging and rethrowing. Frameworks/appservers usually catch and log uncatched exceptions so you will have two (or more) entries for the same exception it the log file which makes debugging hard.


  Log the exception only once!
  
  One of the common pain points that I have noticed is logging and
  rethrowing an exception. As a result, the log files contains the same
  exceptions several times on several stack levels.


Author: Nayaki