Flowable 6.6.0 BPMN用户指南 - 17 高级用例 - 17.13 日志记录会话[实验性]

Flowable 6.6.0 用户指南相关文档下载


《Flowable 6.6.0 BPMN用户指南》

1. 入门
2. 配置
3 The Flowable API
4 Flowable 6.6.0 BPMN用户指南 - (4)Spring集成
5 Spring Boot
6 部署
7 BPMN 2.0简介
8 BPMN 2.0的构造
9 表单(Forms)
10 流程实例迁移
11 JPA
12 历史(History)
13 身份管理(Identity management)
14 REST API
15 CDI集成
16 LDAP集成
17 高级用例

有关Flowable的更多文档,参见:

《Flowable文档大全》


17.13 日志记录会话[实验性]

Added in 6.5.0, Logging sessions allow you to collect information about process execution even if an exception causes the transaction to be rolled back. This is enabled by providing a LoggingListener implementation to the engine configuration. The loggingListener contains a single method called loggingGenerated that takes a list of Jackson ObjectNodes.

In this simple implementation, each ObjectNode is sent to the logger:

添加到6.5.0中的日志会话允许您收集有关流程执行的信息,即使异常导致事务回滚。这是通过向引擎配置提供LoggingListener实现来开启的。loggingListener包含一个名为loggingGenerated 的方法,它接受Jackson对象节点(Jackson ObjectNode)的列表。

在这个简单的实现中,每个ObjectNode都被发送到记录器:

class MyLoggingListener implements LoggingListener{
    static Logger logger = LoggerFactory.getLogger(MyLoggingListener.class);
    
    @Override
    public void loggingGenerated(List<ObjectNode> loggingNodes) {
        loggingNodes.forEach(jsonNodes -> logger.info(jsonNodes.toString()));
    }
}

During process engine configuration, an instance of the LoggingListener is passed

在流程引擎配置期间,将传递LoggingListener的实例

ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration()
      .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
      .setJdbcUrl("jdbc:h2:mem:my-own-db;DB_CLOSE_DELAY=1000")
      .setLoggingListener(new MyLoggingListener())
      .buildProcessEngine();
17.13.1 LoggingSession ObjectNodes

The list of ObjectNodes passed to loggingGenerated method Are JSON objects, with at least the following attributes:

  • message - a human readable message
  • scopeId - a correlation ID to group all messages from the same transaction
  • scopeType - the type of the scope

Additional fields will also be present based on the type of event they describe:

传递给loggingGenerated方法的objectNode列表是JSON对象,至少具有以下属性:

  • message -人类可读信息
  • scopeId-对来自同一事务的所有消息进行分组的相关ID
  • scopeType-作用域(scope)的类型

根据所描述的事件类型,还将显示其他字段:

2020-01-21 10:46:54.852  INFO 4985 --- [  restartedMain] c.e.f.MyLoggingListener                : {"message":"Variable 'initiator' created","scopeId":"a193efb3-3c6d-11ea-a01d-bed6c476b3ed","scopeType":"bpmn","variableName":"initiator","variableType":"null","variableRawValue":null,"variableValue":null,"scopeDefinitionId":"loggingSessionProcess:1:a18d38ef-3c6d-11ea-a01d-bed6c476b3ed","scopeDefinitionKey":"loggingSessionProcess","scopeDefinitionName":"Logging Session Process","__id":"a1948bf5-3c6d-11ea-a01d-bed6c476b3ed","__timeStamp":"2020-01-21T16:46:54.819Z","type":"variableCreate","__transactionId":"a1948bf5-3c6d-11ea-a01d-bed6c476b3ed","__logNumber":1}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

月满闲庭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值