Jacky26 / quarkus-interview-practice

Practice
0 stars 0 forks source link

If you don't get the stack trace, is that a big issue? #4

Closed orangepaydev closed 11 months ago

orangepaydev commented 11 months ago

https://github.com/Jacky26/quarkus-interview-practice/blob/add1828e78ebd7695d2dbad8db75b245da747673/src/main/java/org/jc/controller/DataController.java#L68

The stack trace will not be printed here, discuss Pros and Cons

Jacky26 commented 11 months ago

I think stack trace is important in our error log, just that sometimes by omitting stack trace enable us to focus on short error message to think of potential issue and also reducing volume of log data.

However, there are some cons here when comes to debugging. Without the stack trace here make it more challenging to diagnose root cause of the error, make developer harder to understand the context in which the error occurred. Normally we use stack trace to determine what exact exception was thrown and which line of code leading to the error.

Hence, I think keeping log message concise, having stack trace in error logs is advisable. We need to know what we can do to handle our log volume effectively as well. Besides that, we should have a standard way to follow and practice when we do our logging message for different log level, doing the same across different projects make it easier for every developers to do debugging.