apoc.log.error

过程 Apoc 扩展

apoc.log.error(message, params) - 记录错误消息

签名

apoc.log.error(message :: STRING?, params = [] :: LIST? OF ANY?) :: VOID

输入参数

名称 类型 默认

message

STRING?

null

params

LIST? OF ANY?

[]

配置参数

该过程支持在 APOC 配置文件 (apoc.conf) 中使用以下属性

表 1. 配置参数
名称 (name) type 默认 description(描述)

apoc.user.log.type

字符串

safe

日志记录类型。

  • node: 禁用该过程

  • safe: 将所有 . 和空白字符(空格和制表符)替换为下划线,并将所有字符转换为小写

  • raw: 保持消息原样

apoc.user.log.window.ops

Long

10

时间窗口内允许的日志消息数量。如果超过此配额,日志消息将被跳过。

apoc.user.log.window.time

Long

10000

时间窗口的长度(以毫秒为单位)。

用法示例

我们可以使用以下查询将消息记录到 neo4j.log

CALL apoc.log.error('Hello %s', ['World']);
neo4j.log
2020-11-18 10:22:28.923+0000 ERROR hello_world
© . This site is unofficial and not affiliated with Neo4j, Inc.