This is a creation in Article, where the information may have evolved or changed.
Log in the back-end system is quite important, and students who do too much concurrent service will agree. Relatively speaking, debugging is not very useful, for such projects, I am now accustomed to this development method, there are two reasons:
1.debug only in the development environment, to the production line environment is not the spirit. 2. In parallel computing, debug may not be able to identify potential problems. With the previous experience of node. js, give up debug is not so scary, as long as our program design reasonable, clear structure, log integrity, see the abnormal information after basic can quickly locate the problem. Java when there are log4j, do. NET program when there is log4net, do node. js when there are log4js .... The above modules are all good, so the go project naturally chooses Log4go. Say this log4go is not perfect, and two years did not maintain, white blind such a good name. More serious is that the program exits may have logs not flush to disk:
1 Func Main () {2Log. Debug ("....")3 defer log. Close ()4} After the execution of the program is not log, the problem has not been resolved for two years, see:https://code.google.com/p/log4go/issues/detail?id=8 using open source projects I am more interested in activity, I would like to write a module to solve, and later found the Seelog, tried a bit, but also good, and the recommended configuration and habits and log4x is more unified. seelog Source Address: Https://github.com/cihub/seelog seelog supports customizing different colors when outputting logs in the console, but using ANSI color, in Windows CMD display garbled, the solution is to install a plug-in: http://adoxa.altervista.org/ansicon/after decompression needs to inject: ansicon.exe-i