In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
What are the FISCO BCOS log specifications, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
FISCO BCOS log specification
To make log output more friendly, FISCO BCOS 2.0 designed a general log format and graded logs according to the importance of log output information.
In addition, in order to clearly distinguish the logs of each module, FISCO BCOS 2.0 designed log keywords for each module, and designed various macros to ensure that the log output format is consistent and convenient to write log output code.
This section introduces the FISCO BCOS log specification from three aspects: log format, log level, and log keywords.
General log format
The logs of all FISCO BCOS groups are output to the log_%YYYY%mm%dd%HH.%MM file in the node log directory, which is split every hour. In order to distinguish between group logs and make log output more friendly, FISCO BCOS 2.0 designed a general log format.
The common log format is as follows:
Log_level | time | [g:group_id] [module_name] content
Log_level: log level, which currently includes trace, debug, info, warning, error and fatal, where fatal is output in case of extremely serious errors
Time: log output time, accurate to nanosecond
Group_id: group ID for outputting log records
Module_name: module keyword, such as SYNC for synchronization module and CONSENSUS for consensus module.
Content: logging content
The following is the log output of group 3 when it submits the block:
Info | 2019-06-2616 PBFT 37V 08.253147 | [CONSENSUS] [PBFT] ^ Report,num=0,sealerIdx=0,hash=a4e10062...,next=1,tx=0,nodeIdx=2
The log level is info, the output time is 2019-06-26, the group id is 3, the module is CONSENSUS, and the log keywords are PBFT and Report.
Log level
Log grading is essential for locating problems in a timely manner. FISCO BCOS 2.0 aligns the production environment into trace, debug, info, warning, error, and fatal from low to high log levels where:
Trace and debug logs are mainly used for code debugging
The info level log outputs the key process of the system, which is mainly used to locate problems in the production environment.
Warning log outputs alarm information. When the number of alarm log records exceeds a certain number, the operation and maintenance staff should intervene.
The error log outputs the core error information. When the error log appears in the system, the operation and maintenance staff should intervene.
Fatal logs are generally used in the process of program development and debugging to locate bug as soon as possible. When the system touches impossible logic, the program can be terminated in the form of printing logs, thus exposing logic errors in the development stage.
We hope that while reducing the disk space occupied by logs, we can expose and locate system problems as much as possible. To achieve this, logs of info and above are generally enabled in production environments. The default log level of the block chain nodes generated by FISCO BCOS chain building tool is info, which outputs logs at info, warning, error and fatal levels.
If you need to adjust the log level, you can modify the log.level configuration of config.ini under the node directory, for example, adjust the log level to ≥ debug, as follows:
[log] level=debug
Module log keyword
In order to accurately distinguish multiple module logs, facilitate the location of bug and parse logs, FISCO BCOS 2.0 customizes log keywords for each module, and designs macros to facilitate developers to write log output code, while ensuring consistent log output format and improving the readability of the code.
The main log macros include:
LOG_BADGE: output module information, which is enclosed in square brackets [], thus distinguishing it from other log output information
LOG_DESC: output log description information
LOG_KV: LOG_KV (_ K, _ V) is defined as ","
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.