当前位置:网站首页>第九章 设置结构化日志记录(一)
第九章 设置结构化日志记录(一)
2022-06-26 05:11:00 【yaoxin521123】
第九章 设置结构化日志记录(一)
IRIS 支持结构化日志记录。
创建多个日志,每个日志用于不同的目的。从以前的产品迁移过来的客户可以像过去一样利用这些日志,但现在还可以将所有日志信息导入一个单一的、中央的、机器可读的日志文件——结构化日志。然后可以将此文件与第三方分析工具一起使用。
本文概述了结构化日志中的信息,展示了日志示例,并描述了如何启用结构化日志记录。
结构化日志中可用的信息
当启用结构化日志记录时,系统会将相同的数据写入结构化日志,它也会写入其他日志(无论哪个)。例如,系统将相同的行写入messages.log
和结构化日志。
启用结构化日志记录后,结构化日志包含以下所有信息:
- 写入
messages.log
的信息。这包括需要注意的警报、有关系统启动和关闭的信息、有关日志文件和WIJ
文件的高级信息、有关配置更改 (CPF
) 的信息以及与许可相关的信息。 - 写入审计数据库的信息。详细信息取决于正在审核的事件。
示例输出
本部分显示结构化日志记录实用程序的示例输出,用于名称/值对格式和 JSON
格式。
名称/值对
以下输出使用格式选项 NVP
(名称/值对)。此示例经过编辑以用于显示目的;在实际输出中,每个条目只占一行,条目之间没有空行。
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)."
在这种格式中,文件中的每一行都包含一组由空格分隔的名称/值对。每个名称/值对的格式为 name=value
,如果 value
包含空格字符,则 value
用括号括起来。日志文件中的行包含以下部分或全部名称/值对:
Name | Value |
---|---|
host | 运行 ^LOGDMN 的主机的名称(如果在管道命令中提供)。 |
instance | 运行 ^LOGDMN 的实例的名称(如果在管道命令中提供)。 |
when | 始终包括在内。条目的时间戳,格式为 yyyy-mm-dd hh:mm:ss.sss |
pid | 始终包括在内。生成条目的进程的 ID |
level | 始终包括在内。此条目的日志级别。这具有以下值之一: - DEBUG2 用于详细的调试消息(例如十六进制转储)。 - DEBUG 用于不太详细的调试消息。 - INFO 用于信息性消息,包括所有审计事件。 - WARNING 用于指示可能需要注意但未中断操作的问题。 - SEVERE 用于严重错误,表示操作中断的问题。 -FATAL 用于致命错误,表示问题导致系统无法运行。 |
event | 始终包括在内。生成条目的代码的标识符,通常是类名。 |
text | 始终包括在内。解释条目的描述性字符串。 |
source | 作为审计事件源的组件。对于组件,这始终是 %System 。当应用程序代码写入事件日志时,source 指示应用程序代码中的组件。 |
type | 对审计事件的信息进行分类。 |
group | 审计事件的组(如果有)。 |
namespace | 生成条目的命名空间。这对于检查特定于名称空间的行为很有用,例如应用程序错误和互操作性产品的活动。 |
JSON
以下输出使用格式选项 JSON
。此示例经过编辑以用于显示目的;在实际输出中,每个条目只占一行,条目之间没有空行。
{
"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)."}
在这种格式中,文件中的每一行都是一个带有一组属性的 JSON
对象。属性的名称(以及属性中包含的值)与上一节中为名称/值对列出的名称相同。
边栏推荐
- Codeforces Round #800 (Div. 2)
- Mise en œuvre du routage dynamique par zuul
- 为什么许多shopify独立站卖家都在用聊天机器人?一分钟读懂行业秘密!
- 5. <tag-栈和常规问题>补充: lt.946. 验证栈序列(同剑指 Offer 31. 栈的压入、弹出序列)
- 天才制造者:獨行俠、科技巨頭和AI|深度學習崛起十年
- Classic theory: detailed explanation of three handshakes and four waves of TCP protocol
- vscode config
- 程序人生
- Some parameter settings and feature graph visualization of yolov5-6.0
- ssh连win10报错:Permission denied (publickey,keyboard-interactive).
猜你喜欢
Codeforces Round #802 (Div. 2)(A-D)
Classic theory: detailed explanation of three handshakes and four waves of TCP protocol
The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?
FastAdmin Apache下设置伪静态
MySql如何删除所有多余的重复数据
Learn from small samples and run to the sea of stars
Happy New Year!
Technical past: tcp/ip protocol that has changed the world (precious pictures, caution for mobile phones)
Codeforces Round #802 (Div. 2)(A-D)
UWB超高精度定位系统原理图
随机推荐
【红队】要想加入红队,需要做好哪些准备?
Codeforces Round #800 (Div. 2)
cartographer_backend_constraint
SSH connected to win10 and reported an error: permission denied (publickey, keyboard interactive)
程序人生
百度API地图的标注不是居中显示,而是显示在左上角是怎么回事?已解决!
PowerShell runtime system IO exceptions
程序人生
Generalized linear model (logistic regression, Poisson regression)
红队得分方法统计
Create SSH key pair configuration steps
Codeforces Round #800 (Div. 2)
Lstms in tensorflow_ Cell actual combat
C# 40. byte[]与16进制string互转
The best Chinese open source class of vision transformer, ten hours of on-site coding to play with the popular model of Vit!
出色的学习能力,才是你唯一可持续的竞争优势
Why does the mobile IM based on TCP still need to keep the heartbeat alive?
A company crawling out of its grave
[latex] error type summary (hold the change)
Computer Vision Tools Chain