Logging information is an indispensable activity both in development and in production. However, you should choose what information is needed for debugging (development phase) and what information is needed for routine maintenance (production phase) carefully. Decide carefully about where to log information and about the formatting of the log messages so that the information can be processed and analyzed in the future by other applications.
Avoid logging unnecessary information. This will make the logging output convoluted and it badly affects the performance of your application.
Make sure that the appropriate log level is used, so you only log necessary information by default. As we will see later on in this chapter, it is possible to adjust the log levels to get clues from a running application server at runtime.