At the moment I am developing a website using Spring, Hibernate, Freemarker. Please tell me exactly when to use logging, in which methods or classes, in controllers, or in the service ball? Where is it appropriate to do? I would be grateful for the detailed response)
- no other answer, except: "Where the soul desires" cannot be here. - Temka, too,
- Logs are your debugging helper. The more logs, the easier it is to debug the production bugs. So it makes sense to cover all the logs until it affects the performance. - Nofate ♦
- @Nofate But in post production all logs need to be removed? - Yura
- The question is generally too subjective and should be closed. For example, I like to log the input parameters and the result on all services and controllers in DEBUG, the beginning and end of some internal processing. The most important processes are in INFO. If something is broken, in the exception handler, write to ERROR and wrap it in a business exception. Any abnormal situations that were normally handled are in WARN. In someone else's projects there may be other generally accepted practices on this issue. - Nofate ♦
- What is post-production? Production is already industrial exploitation. Your application serving real users on the battle server. - Nofate ♦
|