第 11 章 日志文件参考


目录服务器将事件记录到日志文件中,这些文件对于解决现有问题和预测潜在问题至关重要,这可能会导致性能失败或不佳。

通过日志文件,您可以实现以下目标:

  • 对问题进行故障排除。
  • 监控服务器活动。
  • 分析目录活动。

要有效地监控目录,您必须了解日志文件的结构和内容。

在本章中您没有找到日志消息的详细列表。显示的信息充当解决常见问题的良好起点,并了解访问、错误、审计、审计失败和安全日志中的记录。

目录服务器实例将日志存储在 /var/log/dirsrv/slapd-instance_name 目录中。

11.1. 访问日志参考

目录服务器访问日志包含有关到目录的客户端连接的详细信息。连接是来自同一客户端的一系列请求,其结构如下:

  • 提供连接索引和客户端的 IP 地址的连接记录
  • 绑定记录
  • 绑定结果记录
  • 当连接、关闭和带出记录时,一组操作请求和操作结果对或单独的记录
  • unbind 记录
  • 封闭记录

访问日志记录示例:

[time_stamp] conn=1 op=73 SRCH base="dc=example,dc=com" scope=2 filter="(&(objectClass=top)(objectClass=ldapsubentry)(objectClass=passwordpolicy))" attrs="distinguishedName"
[time_stamp] conn=1 op=73 RESULT err=0 tag=101 nentries=24 wtime=0.000078414 optime=0.001614101 etime=0.001690742
Copy to Clipboard Toggle word wrap

几乎所有记录都出现在对中:一个服务请求记录、示例中为 SRCH,后跟 RESULT 记录。连接、关闭和带外记录会单独显示。

访问日志有几个级别的日志记录,您可以使用 nsslapd-accesslog-level 属性进行配置。

11.1.1. 访问日志记录级别

不同的访问日志记录级别记录目录服务器执行的不同操作。

访问日志有以下日志级别:

  • 无法访问日志记录(0)。
  • 用于内部访问操作的日志记录(4)。
  • 记录连接、操作和结果的日志记录(256)。默认级别。
  • 用于访问条目和引用的日志记录(512)。

使用 nsslapd-accesslog-level 属性来配置访问日志级别。属性值是 additive :如果您设置了日志级别 260,它包括级别 256 和 4。

11.1.2. 默认访问日志内容

默认情况下,Directory 服务器具有 256 个日志记录级别,其记录可以访问某个条目,包含进一步显示的信息。

连接号(conn)

目录服务器在示例中列出了带有增量连接号 conn=13 的每个外部 LDAP 请求。连接号在服务器启动后立即从 conn=0 开始。

[time_stamp] conn=13 fd=608 slot=608 connection from 172.17.0.2 to 172.17.0.2
Copy to Clipboard Toggle word wrap

目录服务器默认不记录内部 LDAP 请求。要启用内部访问操作的日志记录,请使用 nsslapd-accesslog-level 配置属性。

文件描述符(fd)

从外部 LDAP 客户端到目录服务器的每个连接都需要操作系统中的文件描述符或套接字描述符,本例中为 fd=608fd=608 值表示外部 LDAP 客户端在可用文件描述符总数中使用文件描述符编号 608。

[time_stamp] conn=11 fd=608 slot=608 connection from 172.17.0.2 to 172.17.0.2
Copy to Clipboard Toggle word wrap

插槽号(slot)

示例中的插槽号 slot=608 是访问日志的传统部分,其含义与文件描述符相同。忽略访问日志的这一部分。

[time_stamp] conn=11 fd=608 slot=608 connection from 172.17.0.2 to 172.17.0.2.
Copy to Clipboard Toggle word wrap

操作号(opt)

要处理 LDAP 请求,目录服务器执行一系列操作。对于连接,所有操作请求和操作结果对都具有以 op=0 开始的增量操作号,以识别不同的操作。

[time_stamp] conn=14 op=0 BIND dn="cn=Directory Manager" method=128 version=3
[time_stamp] conn=14 op=0 RESULT err=0 tag=97 nentries=0 wtime=0.000076581 optime=0.000082736 etime=0.000158680
[time_stamp] conn=14 op=1 SRCH base="dc=example,dc=com" scope=2 filter="(uid=bjensen)"
[time_stamp] conn=14 op=2 ABANDON targetop=2 msgid=3 nentries=0 etime=0.0000113702
[time_stamp] conn=14 op=3 UNBIND
[time_stamp] conn=14 op=3 fd=634 closed - U1
Copy to Clipboard Toggle word wrap

在示例中:

  • bind 操作请求的 op=0 和结果
  • LDAP 搜索请求的 op=1 以及结果
  • abandon 操作 op=2
  • unbind 操作的 op=3,LDAP 客户端发送和结果

方法类型(method)

示例中的方法编号 method=128 表示使用哪个 LDAPv3 绑定方法。

[time_stamp] conn=11 op=0 BIND dn="cn=Directory Manager" method=128 version=3
Copy to Clipboard Toggle word wrap

方法类型可以有以下三个可能值之一:

  • 0 用于身份验证
  • 128 用于使用用户密码的简单绑定
  • 使用外部身份验证机制的 SASL 绑定的 SASL

版本号(版本)

版本号表示用于与 LDAP 服务器通信的 LDAP 客户端的 LDAP 版本号。LDAP 版本号可以是 LDAPv2 或 LDAPv3。在示例中,它使用 version=3

[time_stamp] conn=11 op=0 BIND dn="cn=Directory Manager" method=128 version=3
Copy to Clipboard Toggle word wrap

错误号(err)

错误号提供返回执行 LDAP 操作的 LDAP 结果代码。LDAP 错误编号 0 表示操作成功。该示例具有 op=0

[time_stamp] conn=2 op=0 RESULT err=0 tag=97 nentries=0 wtime=0.000076581 optime=0.000082736 etime=0.000158680
Copy to Clipboard Toggle word wrap

标签号(标签)

标签号表示操作返回的结果类型。目录服务器使用 LDAP 协议中的 BER 标签。示例具有 tag=97

[time_stamp] conn=11 op=0 RESULT err=0 tag=97 nentries=0 wtime=0.000076581 optime=0.000082736 etime=0.000158680
Copy to Clipboard Toggle word wrap

下表提供了常用的标签:

Expand
Tag描述

tag=97

客户端绑定操作的结果。

tag=100

Directory 服务器搜索的实际条目。这不是结果标签,访问日志不包含这样的标签。

tag=101

搜索操作的结果。

tag=103

修改操作的结果。

tag=105

add 操作的结果。

tag=107

删除操作的结果。

tag=109

moddn (renaming)操作的结果。

tag=111

比较操作的结果。

tag=115

当操作搜索条目包含到所需条目的引用时,搜索引用。这不是结果标签,访问日志不包含这样的标签。

tag=120

扩展操作的结果。

tag=121

中间操作的结果。

条目数(nentries)

nentries 记录显示搜索操作与 LDAP 客户端请求匹配的条目数。

[time_stamp] conn=11 op=0 RESULT err=0 tag=97 nentries=0 wtime=0.000076581 optime=0.000082736 etime=0.000158680
Copy to Clipboard Toggle word wrap

在示例中,nentries=0 找不到任何匹配的条目。

已经过的时间(etime)

etime 记录显示经过的时间或目录服务器执行 LDAP 操作所需的时间(以秒为单位)。

[time_stamp] conn=11 op=1 RESULT err=0 tag=101 nentries=1 wtime=0.000076581 optime=0.000082736 etime=0.000158680 notes=U
Copy to Clipboard Toggle word wrap

在示例中,目录服务器花费 0.000158680 秒来执行操作。

etime 值 0 表示操作实际需要 0 纳秒才能执行。

LDAP 请求类型

LDAP 请求类型指示发出的 LDAP 请求类型。可能的值有:

  • SRCH 用于搜索操作
  • 修改操作的 MOD
  • DEL 用于删除操作
  • ADD 用于添加操作
  • 用于 moddn (renaming)操作的 MODDN
  • EXT 用于扩展操作
  • ABANDON 用于 abandon 操作
  • 如果 LDAP 请求结果对条目进行排序,SORT serialno
[time_stamp] conn=114 op=68 SORT serialno (1)
Copy to Clipboard Toggle word wrap

在示例中,用括号括起的数字指定 LDAP 请求排序一个候选条目。

LDAP 响应类型

目录服务器可以发出三种 LDAP 响应类型:

  • RESULT 表示客户端 LDAP 请求的结果。
  • ENTRY 表示条目 Directory 服务器返回搜索操作。
  • REFERRAL 表示目录服务器将 LDAP 请求发送到另一台服务器。

RESULT 消息包含以下与性能相关的记录:

wtime
在 worker 线程获取操作前,操作在工作队列中等待的时间
optime
执行任务的实际操作所需的时间
etime
Directory 服务器收到请求时的时间,以及服务器将结果发回到客户端。
注意

wtimeoptime 值提供有关服务器如何处理负载和进程操作的有用信息。因为目录服务器需要一些时间来收集这些统计信息,所以 wtimeoptime 值的总和比 etime 值稍高。

搜索指示器(注意)

目录服务器提供有关在日志条目备注消息中搜索的附加信息。例如:

[time_stamp] conn=11 op=1 RESULT err=0 tag=101 nentries=1 wtime=0.000076581 optime=0.000082736 etime=0.000158680 notes=U
Copy to Clipboard Toggle word wrap

目录服务器支持以下搜索指示符:

Expand
搜索指示器描述

notes=P

页面搜索指示器.具有有限资源的 LDAP 客户端可以控制 LDAP 服务器返回搜索操作结果的速率。当执行的搜索使用 LDAP 控制扩展来简单分页搜索结果时,目录服务器会记录 notes=P paged 搜索指示符。此指示器是信息,不需要进一步的操作。有关页面搜索指示器的详情,请参阅 RFC 2696 规格

notes=A

未索引的搜索指示符。当过滤器中的所有候选属性没有被索引且需要完整表扫描时,目录服务器会记录 notes=A。这可以超过 nsslapd-lookthroughlimit 属性中设置的值。

notes=U

未索引的搜索指示符。在以下情况下目录服务器日志 notes=U

  • 至少一个搜索术语未索引。
  • 搜索操作超过 nsslapd-idlistscanlimit 属性中设置的限制。

notes=F

未知属性指示器.当搜索过滤器包含未知属性时,目录服务器日志 notes=F

notes=M

MFA 插件绑定指示器.当您使用预绑定身份验证插件(如 MFA 插件)为用户帐户配置双因素身份验证时,目录服务器会记录 notes=M

记录可以组合使用值: notes=P,Anotes=U,P

如果没有索引属性,目录服务器必须在数据库中直接搜索它们。这个过程比搜索索引文件更多的资源密集型。

在以下情况下进行未索引搜索:

  • 搜索操作超过 nsslapd-idlistscanlimit 属性中设置的搜索条目数量,即使在使用索引文件时也是如此。有关属性的详情,请查看 nsslapd-idlistscanlimit
  • 不存在索引文件。
  • 索引文件没有以搜索方式配置。

要优化将来的搜索,请在索引中添加频繁搜索的未索引属性。

注意

未索引的搜索指示器通常附带一个大的 etime 值,因为未索引的搜索通常会更耗时。

MFA 插件绑定

当您使用预绑定身份验证插件(如 MFA 插件)为用户帐户配置双因素身份验证时,访问日志会将 notes=M 记录消息记录到文件中:

[time_stamp] conn=1 op=0 BIND dn="uid=jdoe,ou=people,dc=example,dc=com” method=128 version=3
[time_stamp] conn=1 op=0 RESULT err=0 tag=97 nentries=0 wtime=0.000111632 optime=0.006612223 etime=0.006722325 notes=M details="Multi-factor Authentication” dn="uid=jdoe,ou=people,dc=example,dc=com”
Copy to Clipboard Toggle word wrap
注意

要使访问日志记录 notes=M 备注的消息,如果绑定是此插件的一部分,则预绑定身份验证插件必须使用 SLAPI API 设置标志。

与 VLV 相关的条目(VLV)

当搜索涉及虚拟列表视图(VLV)时,Directory 服务器会向访问日志文件记录相应的条目。与其他条目类似,特定于 VLV 的记录将请求和响应信息一起显示:

[time_stamp] conn=67 op=8530 VLV 0:5:0210 10:5397 (0)
Copy to Clipboard Toggle word wrap

在示例中,请求信息为 0:5:0210,其格式为 beforeCount:afterCount:index:contentCount。响应信息为 10:5397 (0),其格式为 targetPosition:contentCount (resultCode)

如果客户端使用 position-by-value VLV 请求,则请求信息格式为 beforeCount: afterCount: value

搜索范围(范围)

scope 条目定义了已执行搜索操作的范围,并可具有以下值之一:

  • 0 用于基本搜索
  • 1 用于一个级别搜索
  • 2 用于子树搜索

扩展操作 OID (oid)

oid 记录提供已执行扩展操作的对象标识符(OID)。以下是使用扩展操作 OID 访问日志记录示例:

[time_stamp] conn=13 op=1 EXT oid="2.16.840.1.113730.3.5.3"
...
[time_stamp] conn=15 op=3 EXT oid="2.16.840.1.113730.3.5.5"
Copy to Clipboard Toggle word wrap

目录服务器支持以下 LDAPv3 扩展操作列表及其 OID:

Expand
扩展操作名称描述OID

目录服务器启动复制请求

复制控制器请求复制会话。

2.16.840.1.113730.3.5.3

目录服务器复制响应

对 Start Replication Request 扩展操作或 End Replication Request 扩展操作的响应中的复制响应程序。

2.16.840.1.113730.3.5.4

目录服务器结束复制请求

复制控制器终止复制会话。

2.16.840.1.113730.3.5.5

目录服务器复制条目请求

使用状态信息传输条目(csnUniqueIdentifier),用于执行副本初始化。

2.16.840.1.113730.3.5.6

目录服务器 Bulk 导入开始

客户端使用 Bulk Import Start 操作将批量导入与导入的后缀一起请求,Directory 服务器则表示可能开始批量导入。

2.16.840.1.113730.3.5.7

Directory Server Bulk Import Finished

客户端使用 Bulk Import Finished 操作结束批量导入,Directory 服务器确认批量导入结束。

2.16.840.1.113730.3.5.8

更改序列号(csn)

csn 消息(如 csn=3b4c8cfb000000030000 )表示 Directory 服务器收到由其 'csn' 识别的更新并处理它。

abandon 消息(ABANDON)

abandon 消息表示客户端或 Directory 服务器终止一个操作。

以下是包含带外消息的日志记录示例:

[time_stamp] conn=12 op=1 SRCH base="dc=example,dc=com" scope=2 filter="(uid=bjensen)"
[time_stamp] conn=12 op=2 ABANDON targetop=2 msgid=3 nentries=0 etime=0.0000113980
Copy to Clipboard Toggle word wrap

nentries=0 值表示在操作被终止前发送的条目数,etime=0.0000113980 值表示已经经过的时间(以秒为单位),而 targetop=2 对应于 Directory 服务器之前启动的操作号(opt=2)。

如果 Directory Server 没有找到与bandon 的操作,日志记录包含一个 targetop=NOTFOUND 信息:

[time_stamp] conn=12 op=2 ABANDON targetop=NOTFOUND msgid=2
Copy to Clipboard Toggle word wrap

示例消息表示 Directory 服务器之前完成了操作,或者它是未知操作。

消息 ID (msgid)

LDAP SDK 客户端生成消息 ID,如 msgid=2,这也是 LDAP 操作标识符。msgid 值可能与 opt 值不同,但它标识相同的操作。目录服务器使用 ABANDON 操作记录 msgid,并告知用户哪个客户端操作被取消了:

[time_stamp] conn=12 op=2 ABANDON targetop=NOTFOUND msgid=2
Copy to Clipboard Toggle word wrap
注意

对于连接,目录服务器 操作 号选择从 0 开始。在大多数 LDAP SDK/客户端实现中,消息 ID 号 msgid 开始计数为 1。这解释了 msgid 经常等于 Directory Server opt 和 1 的原因。

SASL 多阶段绑定日志记录

目录服务器记录绑定进程的每个阶段。SASL 连接的错误代码实际上是返回码:

[time_stamp] conn=16 op=0 BIND dn="" method=sasl version=3 mech=DIGEST-MD5
[time_stamp] conn=16 op=0 RESULT err=14 tag=97 nentries=0 wtime=0.000076581 optime=0.000082736 etime=0.000158680, SASL bind in progress
Copy to Clipboard Toggle word wrap

示例记录表示 SASL 绑定当前正在进行中(SASL 绑定正在进行中),并且返回码为 err=14。这意味着连接仍然处于打开状态。目录服务器将 SASL 绑定信息与 LDAP 版本号(version=3)和使用的 SASL 机制记录(mech=DIGEST-MD5)。

注意

由于 SASL 身份验证需要多个步骤,因此在目录服务器完成绑定过程时,目录服务器会在绑定 RESULT 行中记录经过身份验证的 DN (用于访问控制决策的 DN)。这显示了映射到 SASL 绑定请求的条目:

[time_stamp] conn=14 op=1 RESULT err=0 tag=97 nentries=0 wtime=0.000076581 optime=0.000082736 etime=0.000158680 dn="uid=jdoe,dc=example,dc=com"
Copy to Clipboard Toggle word wrap

11.1.3. 非默认访问日志内容

当您设置非默认日志级别或应用特定的日志配置时,目录服务器将开始向访问日志文件记录其他信息。

内部操作记录

当您为内部操作启用日志记录时,Directory 服务器将开始记录由 Directory 服务器或客户端启动的内部操作。

服务器启动的内部操作

如果客户端删除条目,服务器会运行多个内部操作,如查找用户所属的条目和更新组。

以下示例显示了服务器发起的内部操作日志格式:

[time_stamp] conn=Internal(0) op=0(0)(0) MOD dn="cn=uniqueid generator,cn=config"
[time_stamp] conn=Internal(0) op=0(0)(0) RESULT err=0 tag=48 nentries=0 wtime=0.0003979676 optime=0.0003989250 etime=0.0007968796
Copy to Clipboard Toggle word wrap

示例记录具有 conn=Internal,后跟 (0)op=0 (0) (nesting_level)。操作 ID 和内部操作 ID 始终为 0。对于非嵌套日志,记录嵌套级别为 0。

客户端启动的内部操作

除了已执行搜索的详细信息外,客户端启动的内部操作日志还具有搜索基础、范围、过滤器和请求的搜索属性。以下示例显示了日志记录的格式:

[time_stamp] conn=5 (Internal) op=15(1)(0) SRCH base="cn=config,cn=userroot,cn=ldbm database,cn=plugins,cn=config" scope=1 filter="objectclass=vlvsearch" attrs=ALL
[time_stamp] conn=5 (Internal) op=15(1)(0) RESULT err=0 tag=48 nentries=0 wtime=0.0000143989 optime=0.0000151450 etime=0.0000295419
[time_stamp] conn=5 (Internal) op=15(2)(0) SRCH base="cn=config,cn=example,cn=ldbm database,cn=plugins,cn=config" scope=1 filter="objectclass=vlvsearch" attrs=ALL
[time_stamp] conn=5 (Internal) op=15(2)(0) RESULT err=0
Copy to Clipboard Toggle word wrap

示例记录具有 conn 记录,该记录设置为客户端连接 ID,后跟字符串 (Internal)op 记录包含操作 ID,后跟 (internal_operation_ID) (nesting_level)。内部操作 ID 可能有所不同。对于非嵌套日志条目,嵌套级别为 0。

启用插件日志的内部操作

如果将 nsslapd-plugin-logging 参数设置为 on,并且启用了内部操作日志记录(4),目录服务器还会记录插件的内部操作。

例如,如果您删除 uid=user,dc=example,dc=com 条目,并且 referential Integrity 插件会自动从 example 组中删除此条目,服务器会记录以下内容:

[time_stamp] conn=2 op=37 DEL dn="uid=user,dc=example,dc=com"
[time_stamp] conn=2 (Internal) op=37(1) SRCH base="uid=user,dc=example,dc=com" scope=0 filter="(|(objectclass=*)(objectclass=ldapsubentry))" attrs=ALL
[time_stamp] conn=2 (Internal) op=37(1) RESULT err=0 tag=48 nentries=1 wtime=0.0000062569 optime=0.0000067203 etime=0.0000129148
[time_stamp] conn=2 (Internal) op=37(2) SRCH base="dc=example,dc=com" scope=2 filter="(member=uid=user,dc=example,dc=com)" attrs="member"
[time_stamp] conn=2 (Internal) op=37(2) RESULT err=0 tag=48 nentries=0 wtime=0.0000058002 optime=0.0000065198 etime=0.0000123162
[time_stamp] conn=2 (Internal) op=37(3) SRCH base="dc=example,dc=com" scope=2 filter="(uniquemember=uid=user,dc=example,dc=com)" attrs="uniquemember"
[time_stamp] conn=2 (Internal) op=37(3) RESULT err=0 tag=48 nentries=1 wtime=0.0000062123 optime=0.0000066022 etime=0.0000128104
[time_stamp] conn=2 (Internal) op=37(4) MOD dn="cn=example,dc=example,dc=com"
[time_stamp] conn=2 (Internal) op=37(5) SRCH base="cn=example,dc=example,dc=com" scope=0 filter="(|(objectclass=\*)(objectclass=ldapsubentry))" attrs=ALL
[time_stamp] conn=2 (Internal) op=37(5) RESULT err=0 tag=48 nentries=1 wtime=0.0000061994 optime=0.0000068742 etime=0.0000130685
[time_stamp] conn=2 (Internal) op=37(4) RESULT err=0 tag=48 nentries=0 wtime=0.0002600573 optime=0.0002617786 etime=0.0005217545
[time_stamp] conn=2 (Internal) op=37(6) SRCH base="dc=example,dc=com" scope=2 filter="(owner=uid=user,dc=example,dc=com)" attrs="owner"
[time_stamp] conn=2 (Internal) op=37(6) RESULT err=0 tag=48 nentries=0 wtime=0.000061678 optime=0.000076107 etime=0.0000137656
[time_stamp] conn=2 (Internal) op=37(7) SRCH base="dc=example,dc=com" scope=2 filter="(seeAlso=uid=user,dc=example,dc=com)" attrs="seeAlso"
[time_stamp] conn=2 (Internal) op=37(7) RESULT err=0 tag=48 nentries=0 wtime=0.0000031789 optime=0.0000035354 etime=0.0000066978
[time_stamp] conn=2 (Internal) op=37(8) SRCH base="o=example" scope=2 filter="(member=uid=user,dc=example,dc=com)" attrs="member"
[time_stamp] conn=2 (Internal) op=37(8) RESULT err=0 tag=48 nentries=0 wtime=0.0000030987 optime=0.0000032456 etime=0.0000063316
[time_stamp] conn=2 (Internal) op=37(9) SRCH base="o=example" scope=2 filter="(uniquemember=uid=user,dc=example,dc=com)" attrs="uniquemember"
[time_stamp] conn=2 (Internal) op=37(9) RESULT err=0 tag=48 nentries=0 wtime=0.0000021958 optime=0.0000026676 etime=0.0000048634
[time_stamp] conn=2 (Internal) op=37(10) SRCH base="o=example" scope=2 filter="(owner=uid=user,dc=example,dc=com)" attrs="owner"
[time_stamp] conn=2 (Internal) op=37(10) RESULT err=0 tag=48 nentries=0 wtime=0.0000022109 optime=0.00000268003 etime=00000048854
[time_stamp] conn=2 (Internal) op=37(11) SRCH base="o=example" scope=2 filter="(seeAlso=uid=user,dc=example,dc=com)" attrs="seeAlso"
[time_stamp] conn=2 (Internal) op=37(11) RESULT err=0 tag=48 nentries=0 wtime=0.0000021786 optime=0.0000024867 etime=0.0000046522
[time_stamp] conn=2 op=37 RESULT err=0 tag=107 nentries=0 wtime=0.005147365 optime=0.005150798 etime=0.0010297858
Copy to Clipboard Toggle word wrap

访问条目和引用

当您启用对条目的访问和引用(512)的日志记录时,Directory 服务器在访问日志文件中有以下记录:

[time_stamp] conn=306 fd=60 slot=60 connection from 127.0.0.1 to 127.0.0.1
[time_stamp] conn=306 op=0 SRCH base="dc=example,dc=com" scope=2 filter="(description=*)" attrs=ALL
[time_stamp] conn=306 op=0 ENTRY dn="ou=Special
[time_stamp] conn=306 op=0 ENTRY dn="cn=Accounting Managers,ou=groups,dc=example,dc=com"
[time_stamp] conn=306 op=0 ENTRY dn="cn=HR Managers,ou=groups,dc=example,dc=com"
[time_stamp] conn=306 op=0 ENTRY dn="cn=QA Managers,ou=groups,dc=example,dc=com"
[time_stamp] conn=306 op=0 ENTRY dn="cn=PD Managers,ou=groups,dc=example,dc=com"
[time_stamp] conn=306 op=0 ENTRY dn="ou=Red Hat Servers,dc=example,dc=com"
[time_stamp0] conn=306 op=0 REFERRAL
Copy to Clipboard Toggle word wrap

示例具有日志记录级别 768 (512 + 256),并显示六个条目,另一个引用搜索请求返回在响应中。

选项描述

options=persistent 消息表示 Directory 服务器执行持久搜索。您可以使用持久性搜索来监控目的,并在发生更改时配置返回到给定配置的更改。

以下示例显示了包含选项描述的 5124 日志级别。

[time_stamps] conn=1 (Internal) op=2(1)(0) SRCH base="cn=\22dc=example,dc=com\22,cn=mapping tree,cn=config"scope=0 filter="objectclass=nsMappingTree"attrs="nsslapd-referral" options=persistent
Copy to Clipboard Toggle word wrap

每个搜索操作的统计信息

当您将 nsslapd-statlog-level 属性设置为 1 时,访问日志开始收集指标,如索引查找数量和索引查找的整体持续时间,每个搜索操作。

[time_stamps] conn=1 op=73 SRCH base="dc=example,dc=com" scope=2 filter="(cn=user_*)" attrs=ALL
[time_stamps] conn=1 op=73 STAT read index: attribute=objectclass key(eq)=referral --> count 0
[time_stamps] conn=1 op=73 STAT read index: attribute=cn key(sub)=er_ --> count 24
[time_stamps] conn=1 op=73 STAT read index: attribute=cn key(sub)=ser --> count 25
[time_stamps] conn=1 op=73 STAT read index: attribute=cn key(sub)=use --> count 25
[time_stamps] conn=1 op=73 STAT read index: attribute=cn key(sub)=^us --> count 24
[time_stamps] conn=1 op=73 STAT read index: duration 0.000010276
[time_stamps] conn=1 op=73 RESULT err=0 tag=101 nentries=24 wtime=0.00007841
Copy to Clipboard Toggle word wrap

日志记录示例显示,在搜索带有 filter (cn=user solutions) 时,Directory 服务器执行以下数据库查找数量:

  • 0 用于引用
  • 24 用于 er_ key
  • 25 代表 ser
  • 25 代表使用
  • 24 代表 ^us 密钥

11.1.4. 常见连接代码

目录服务器在关闭的日志消息中添加连接代码,以及与连接 closure 相关的其他信息。

Expand
连接代码描述

A1

客户端中止连接。

B1

遇到损坏的 BER 标签。当目录服务器收到通过线路发送的损坏的 BER 标签时,目录服务器会将 B1 连接代码记录到访问日志。BER 标签可能会因为物理层网络问题或错误的 LDAP 客户端操作而损坏,如 LDAP 客户端在接收所有请求结果前取消操作。

B2

BER 标签大于 nsslapd-maxbersize 属性值。

B3

遇到损坏的 BER 标签。

B4

服务器无法将响应发回到客户端。

P2

检测到关闭或损坏的连接。

T1

在您可以在 nsslapd-idletimeout 属性中设置的空闲周期后,客户端不会收到结果。

T2

nsslapd-ioblocktimeout 中设置一段时间后,服务器关闭连接到停滞的 LDAP 客户端。

T3

服务器关闭连接,因为超过了页结果搜索的指定时间限制。

U1

服务器在客户端发送未绑定请求后关闭连接。服务器在收到未绑定请求时始终关闭连接。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat