發表文章

10 Tips for Proper Application Logging

圖片
Reference: https://www.javacodegeeks.com/2011/01/10-tips-proper-application-logging.html   Our latest   JCP partner ,   Tomasz Nurkiewicz , has submitted a number of posts describing the basic principles of proper application   logging . I found them quite interesting, thus I decided to aggregate them in a more compact format and present them to you. So, here are his suggestions for clean and helpful logs:(NOTE: The original posts have been slightly edited to improve readability) 1) Use the appropriate tools for the job Many programmers seem to forget how important is logging an application’s behavior and its current activity. When somebody puts: 1 log.info( "Happy and carefree logging" ); happily somewhere in the code, he probably doesn’t realize the importance of application logs during maintenance, tuning and failure identification. Underestimating the value of good logs is a terrible mistake. In my opinion, SLF4J is the best logging API available, mostl