当前位置:网站首页>Log writing specification
Log writing specification
2022-06-30 05:02:00 【StudyHard_ luozhongxu】
Log purpose
- Problem tracking : When debugging the program , Through the log tracker bug, It can also be found by the user bug after , Analyze and locate problems through logs .
- Condition monitoring : The running status of the system can be viewed through the log , Find and locate problems .
- Security audit : By analyzing the log , You can find out whether there are unauthorized operations .
Log type
- Safety information : Record system boundary interaction behavior and information .
- Business information : Record the internal business processing behavior and information of the system .
- Performance information : Record the supporting ability of the system hardware for business processing .
The level of logging
- ERROR( error ): It has affected the normal operation of the system , And the system cannot recover to the normal operation state by itself .
- WARN( Warning ): There is a problem with the general module of the system , It does not affect the operation of the system .
- INFO( notice ): Change of system operation status during system operation , Or key business processing records and other information concerned by users or administrators during system operation .
- DEBUG( debugging ): The most detailed record , Generally, it is the system execution process , And function parameters and return values , It is mainly used to assist programmers in developing .
- TRACE( track ): similar debug, Rarely used in general .
Log output
- ERROR: A short description of the error , Key parameters related to this error , If there is any abnormality , There should be an exception StackTrace.
- WARN: A brief description of the alarm , Key parameters related to this error , If there is any abnormality , There should be an exception StackTrace.
- INFO: Brief and comprehensive information description , If there is relevant dynamic key data , To be output together , For example, related ID、 Name, etc .
- DEBUG: A brief description , related data , If there is any abnormality , There should be an exception StackTrace.
log Writing norms
- For most foreseeable cases, a single instance of class, Can not add static Prefix ; Most of the cases may be multiple , Especially those that need to be created frequently class, We ask to add static Prefix .
- System startup parameters 、 To configure 、 environment variable 、System.Properties Such information is very important for the normal operation of the software , The output of this information helps the installation and configuration personnel to quickly locate problems through logs , Therefore, it is necessary for the program to use the key parameters in the startup process 、 Variables are output in the log . Attention should be paid to when outputting , Not all the output of one brain , Instead, the configuration information involved in software operation is output .
- Function start and end add log, It is convenient to view the program running process .
- The function passes in parameters and returns parameters using log Print , It is convenient to check whether the parameter is passed incorrectly .
- log Data with unclear meaning in ( Such as : Simple numbers, etc ) It can be converted to a string that can express meaning for printing .
- log use the same pattern , Such as case , Same data name, etc .
- log Print by level , Easy to debug and view .
This article is a summary of some information on the Internet , And some of my own experience , If there are any deficiencies, please correct .
This article is only for reference and learning !
边栏推荐
- Connect() and disconnect() of socket in C #
- Unity Logitech steering wheel access
- Chapter 8 primitive processing of OpenGL super classic (version 7)
- Steamvr causes abnormal scene camera
- Pycharm database tool
- Unity ontriggerenter does not call
- Recommended cultural landmarks of these tourist attractions in Bangkok
- 图的一些表示方式、邻居和度的介绍
- Singapore must visit these scenic spots during the Spring Festival
- Some books you should not miss when you are new to the workplace
猜你喜欢

Photon pun refresh hall room list

Unreal 4 learning notes - data storage using blueprints

Connect() and disconnect() of socket in C #

Output directory of log files after unity3d packaging

UE4 method of embedding web pages

Recommended cultural landmarks of these tourist attractions in Bangkok

The golden deer, a scenic spot in London -- a sailing museum that tells vivid sailing stories

力扣2049:统计最高分的节点数目

力扣977. 有序数组的平方

SCM learning notes: interrupt learning
随机推荐
Universal Studios Singapore: a good place for a one-day parent-child tour in Singapore
Unity multiple UI page turning left and right
Basic operations of Oracle data
Important knowledge points in unity3d
Redis cluster concept
Deeply understand the function calling process of C language
Collective system
C # equipment synthesis
Autowired注解警告的解决办法
On mask culling of unity
Unity Logitech steering wheel access
Spring Festival Tourism Strategy: welcome the new year in Bangkok, Thailand
Chapter 10 of OpenGL super classic (7th Edition) calculation shader
力扣周赛293题解
Unrealeengine4 - about uobject's giant pit that is automatically GC garbage collected
Keywords implements and @override
Unity3d realizes Google Digital Earth
Unreal 4 learning notes - set player birth point
【 VCS + Verdi joint simulation】 ~ Taking Counter as an Example
Win10 vs2015 compiling curaengine