当前位置:网站首页>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 .
边栏推荐
- Dbeaver installation and configuration of offline driver
- Some parameter settings and feature graph visualization of yolov5-6.0
- SSH connected to win10 and reported an error: permission denied (publickey, keyboard interactive)
- 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)
- C# 39. string类型和byte[]类型相互转换(实测)
- Apktool tool usage document
- 第九章 设置结构化日志记录(一)
- cartographer_local_trajectory_builder_2d
- Use to_ Numeric to numeric type
- skimage.morphology.medial_axis
猜你喜欢

What is UWB in ultra-high precision positioning system

Genius makers: lone Rangers, technology giants and AI | ten years of the rise of in-depth learning

Tp5.0 framework PDO connection MySQL error: too many connections solution

cartographer_backend_constraint

-Discrete Mathematics - Analysis of final exercises

Ad tutorial series | 4 - creating an integration library file

UWB超高精度定位系统架构图

cartographer_fast_correlative_scan_matcher_2d分支定界粗匹配

ModuleNotFoundError: No module named ‘numpy‘

【Unity3D】刚体组件Rigidbody
随机推荐
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
[geek] product manager training camp
微服务之间的Token传递之一@Feign的token传递
thread priority
6.1 - 6.2 公鑰密碼學簡介
Machine learning final exercises
[unity3d] rigid body component
Schematic diagram of UWB ultra high precision positioning system
Protocol selection of mobile IM system: UDP or TCP?
ThreadPoolExecutor implements file uploading and batch inserting data
【Unity3D】碰撞体组件Collider
C# 39. string类型和byte[]类型相互转换(实测)
RESNET in tensorflow_ Train actual combat
广和通联合安提国际为基于英伟达 Jetson Xavier NX的AI边缘计算平台带来5G R16强大性能
6.1 - 6.2 公钥密码学简介
cartographer_local_trajectory_builder_2d
ModuleNotFoundError: No module named ‘numpy‘
Classic theory: detailed explanation of three handshakes and four waves of TCP protocol
pycharm 导包错误没有警告
Two step processing of string regular matching to get JSON list