当前位置:网站首页>Chapter 9 setting up structured logging (I)
Chapter 9 setting up structured logging (I)
2022-06-26 05:13:00 【yaoxin521123】
List of articles
Chapter nine Set up structured logging ( One )
IRIS Support structured logging .
Create multiple logs , Each log is used for a different purpose . Customers who have migrated from previous products can use these logs as before , But now you can import all the log information into a single 、 In the middle 、 Machine readable log files —— Structured log . You can then use this file with third-party analysis tools .
This article provides an overview of the information in structured logs , Shows a sample log , It also describes how to enable structured logging .
Information available in structured logs
When you enable structured logging , The system will write the same data to the structured log , It also writes to other logs ( No matter which ). for example , The system writes the same lines to messages.log And structured logs .
After enabling structured logging , The structured log contains all the following information :
- write in
messages.logInformation about . This includes alerts that need attention 、 Information about system startup and shutdown 、 About log files andWIJAdvanced information about files 、 About configuration changes (CPF) And license related information . - Information written to the audit database . The details depend on the event being audited .
Sample output
This section shows sample output from the structured logging utility , For names / Value pair format and JSON Format .
name / It's worth it
The following output uses formatting options NVP( name / It's worth it ). This example has been edited for display purposes ; In actual output , Each entry occupies only one line , There are no blank lines between entries .
when="2019-08-01 18:43:02.216" pid=8240 level=SEVERE event=Utility.Event
text="Previous system shutdown was abnormal, system forced down or crashed"
when="2019-08-01 18:43:05.290" pid=8240 level=SEVERE event=Utility.Event
text="LMF Error: No valid license key. Local key file not found and LicenseID not defined."
when="2019-08-01 18:43:05.493" pid=8240 level=WARNING event=Generic.Event
text="Warning: Alternate and primary journal directories are the same"
when="2019-08-01 18:46:10.493" pid=11948 level=WARNING event=System.Monitor
text="CPUusage Warning: CPUusage = 79 ( Warnvalue is 75)."
In this format , Each line in the file contains a set of names separated by spaces / It's worth it . Each name / The format of the value pair is name=value, If value Contains space characters , be value Enclosed in brackets . The lines in the log file contain some or all of the following names / It's worth it :
| Name | Value |
|---|---|
| host | function ^LOGDMN The name of the host ( If... Is provided in the pipeline command ). |
| instance | function ^LOGDMN The name of the instance of ( If... Is provided in the pipeline command ). |
| when | Always include . Timestamp of the entry , The format is yyyy-mm-dd hh:mm:ss.sss |
| pid | Always include . Of the process that generated the entry ID |
| level | Always include . Log level for this entry . This has one of the following values : - DEBUG2 For detailed debug messages ( For example, hexadecimal dump ). - DEBUG For less detailed debug messages . - INFO For informational messages , Including all audit events . - WARNING Used to indicate problems that may require attention but do not interrupt the operation . - SEVERE For serious errors , Indicates that the operation is interrupted . -FATAL For fatal errors , Indicates that the system cannot run due to the problem . |
| event | Always include . Identifier of the code that generated the entry , Usually the class name . |
| text | Always include . A descriptive string that interprets an entry . |
| source | Components that act as audit event sources . For components , This is always %System. When application code writes to the event log ,source Indicates the components in the application code . |
| type | Classify the information of audit events . |
| group | Group of audit events ( If there is ). |
| namespace | Generate the namespace of the entry . This is useful for checking namespace specific behavior , For example, application errors and activities of interoperability products . |
JSON
The following output uses formatting options JSON. This example has been edited for display purposes ; In actual output , Each entry occupies only one line , There are no blank lines between entries .
{
"when": "2019-08-07 14:11:04.904", "pid": "8540", "level": "SEVERE", "event": "Utility.Event",
"text": "Previous system shutdown was abnormal, system forced down or crashed"}
{
"when": "2019-08-07 14:11:08.155", "pid": "8540", "level": "SEVERE", "event": "Utility.Event",
"text": "LMF Error: No valid license key. Local key file not found and LicenseID not defined."}
{
"when": "2019-08-07 14:11:08.311", "pid": "8540", "level": "WARNING", "event": "Generic.Event",
"text": "Warning: Alternate and primary journal directories are the same"}
{
"when": "2019-08-07 14:16:13.843", "pid": "10816", "level": "WARNING", "event": "System.Monitor",
"text": "CPUusage Warning: CPUusage = 84 ( Warnvalue is 75)."}
In this format , Each line in the file is a with a set of attributes JSON object . Name of property ( And the value contained in the attribute ) And the name in the previous section / Value pairs are listed with the same name .
边栏推荐
- Introduction to classification data cotegory and properties and methods of common APIs
- date_ Range creation date range freq parameter value table and creation example
- 2.< tag-动态规划和常规问题>lt.343. 整数拆分
- 关于支付接口回调地址参数字段是“notify_url”,签名过后的特殊字符url编码以后再解码后出现错误(¬ , ¢, ¤, £)
- Guanghetong and anti international bring 5g R16 powerful performance to the AI edge computing platform based on NVIDIA Jetson Xavier nx
- Tensorflow visualization tensorboard "no graph definition files were found." error
- Image translation /gan:unsupervised image-to-image translation with self attention networks
- 递归遍历目录结构和树状展现
- [leetcode] 713: subarray with product less than k
- zencart新建的URL怎么重写伪静态
猜你喜欢

Codeforces Round #800 (Div. 2)

apktool 工具使用文档

5. < tag stack and general problems > supplement: lt.946 Verify the stack sequence (the same as the push in and pop-up sequence of offer 31. stack)

5. <tag-栈和常规问题>补充: lt.946. 验证栈序列(同剑指 Offer 31. 栈的压入、弹出序列)

ECCV 2020 double champion team, take you to conquer target detection on the 7th

torchvision_ Transform (image enhancement)

Second day of deep learning and tensorfow

ModuleNotFoundError: No module named ‘numpy‘

百度API地图的标注不是居中显示,而是显示在左上角是怎么回事?已解决!

UWB超高精度定位系统原理图
随机推荐
百度API地图的标注不是居中显示,而是显示在左上角是怎么回事?已解决!
Final review of brain and cognitive science
Ad tutorial series | 4 - creating an integration library file
localStorage浏览器本地储存,解决游客不登录的情况下限制提交表单次数。
ThreadPoolExecutor实现文件上传批量插入数据
How to select the data transmission format of instant messaging application
[ide (imagebed)]picgo+typora+aliyunoss deployment blog Gallery (2022.6)
Classic theory: detailed explanation of three handshakes and four waves of TCP protocol
UWB ultra high precision positioning system architecture
Codeforces Round #800 (Div. 2)
Mise en œuvre du routage dynamique par zuul
Beidou navigation technology and industrial application of "chasing dreams in space and feeling for Beidou"
《财富自由之路》读书之一点体会
Illustration of ONEFLOW's learning rate adjustment strategy
ssh连win10报错:Permission denied (publickey,keyboard-interactive).
ThreadPoolExecutor implements file uploading and batch inserting data
5. < tag stack and general problems > supplement: lt.946 Verify the stack sequence (the same as the push in and pop-up sequence of offer 31. stack)
红队得分方法统计
[greedy college] Figure neural network advanced training camp
[leetcode] 713: subarray with product less than k