Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In general logging is a good idea.
  2. Use Commons Logging Slf4j.
  3. For debug messages, call if (log.isDebugEnabled()) prior to calling log.debug().
  4. The following code is usually bad. There is no need to log exception and re-throw it:
    Code Block
    try {
        
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
        throw new RuntimeException(e);
    }
    
    Either log it, or re-throw.

...