[slf4j-user] Use same message in log and Exception

Kostis Anagnostopoulos ankostis at gmail.com
Mon Jul 5 14:28:22 CEST 2010


On Mon, Jul 5, 2010 at 8:40 AM, Jacob Kjome <hoju at visi.com> wrote:
> Maybe you have a unique situation, but the general rule is that you log where you
> handle the exception, not where you throw it.  Otherwise you may end up with logs
> containing duplicate messages.

Thre are valid reasons to log an exception on it throwing site.

When implementing servers for instance,
we do not want to include all the available information within the
thrown exceptions,
since that would reveal sensitive bits to the remote peer.

Therefore we have to log this extra infos at the throwing site.


Regards,
  Kostis Anagnostopoulos


More information about the slf4j-user mailing list