当前位置:网站首页>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 .
边栏推荐
- 线程优先级
- Generalized linear model (logistic regression, Poisson regression)
- Tp5.0 framework PDO connection MySQL error: too many connections solution
- SSH connected to win10 and reported an error: permission denied (publickey, keyboard interactive)
- PHP one sentence Trojan horse
- As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source
- Datetime data type - min() get the earliest date and date_ Range() creates a date range, timestamp() creates a timestamp, and tz() changes the time zone
- Zuul 实现动态路由
- [IDE(ImageBed)]Picgo+Typora+aliyunOSS部署博客图床(2022.6)
- Muke.com actual combat course
猜你喜欢

apktool 工具使用文档

《财富自由之路》读书之一点体会

cartographer_fast_correlative_scan_matcher_2d分支定界粗匹配
![C# 39. Conversion between string type and byte[] type (actual measurement)](/img/33/046aef4e0c1d7c0c0d60c28e707546.png)
C# 39. Conversion between string type and byte[] type (actual measurement)

A company crawling out of its grave

As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source

Machine learning final exercises

torchvision_transform(图像增强)

一个从坟墓里爬出的公司

zencart新建的URL怎么重写伪静态
随机推荐
Create a binary response variable using the cut sub box operation
6.1 - 6.2 公鑰密碼學簡介
ModuleNotFoundError: No module named ‘numpy‘
Sentimentin tensorflow_ analysis_ layer
As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source
The first gift of the project, the flying oar contract!
Muke.com actual combat course
Apktool tool usage document
A beginner's entry is enough: develop mobile IM from zero
Pytorch forecast house price
First day of deep learning and tensorflow learning
MySql如何删除所有多余的重复数据
第九章 设置结构化日志记录(一)
skimage.morphology.medial_axis
Cookie and session Basics
[unity3d] rigid body component
How to select the data transmission format of instant messaging application
Keras actual combat cifar10 in tensorflow
Modify the case of the string title(), upper(), lower()
C# 39. string类型和byte[]类型相互转换(实测)