If you do `log.error("blah: " + e.getMessage())` rather than `log.error("blah: ", e)` then I will personally hunt you down, come to your house, and give you a bloody good talking to as to why stack traces are free, useful debugging tools, and you've just wasted my time by omitting it.

  • 3
    Not just that. NPEs often don't have a message. So logging a message is as good as nothing.
  • 0
    I mean yes
  • 1
    Logging should have a context btw

    And context is super duper wonderful for finding needles in haystacks.

    I'd do what you described in both cases.
  • 2
Add Comment