- Throwing and logging exception at same time creates multiple logs
The following example shows the improper and proper approach
Improper Approach

catch Exception class and log an Exception
Proper Approach

Handled only Exception instead log an error
08.Secure Coding Practices for Error Handling
The following example shows the improper and proper approach

catch Exception class and log an Exception

Handled only Exception instead log an error