[Go] Log record

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.