则我们可以使用下面查询条件:
- http://{your_ObjectLogger_address}/ObjectLogger/log/query?appName=myBootApp&objectName=TaskModel&objectId=9
查询到如下结果:
- {
- "respMsg": "成功",
- "respData": [
- {
- "id": 15,
- "appName": "myBootApp",
- "objectName": "TaskModel",
- "objectId": 9,
- "actor": "actor name",
- "action": "editTask",
- "actionName": "edit Task",
- "extraWords": "via app",
- "comment": "some comments",
- "actionTime": "2019-04-10T10:56:17.000+0000",
- "actionItemModelList": [
- {
- "id": 18,
- "actionId": 15,
- "attributeType": "NORMAL",
- "attribute": "taskName",
- "attributeName": "TASK",
- "oldValue": "oldName",
- "newValue": "newName",
- "diffValue": null
- },
- {
- "id": 19,
- "actionId": 15,
- "attributeType": "USERID",
- "attribute": "userId",
- "attributeName": "USER",
- "oldValue": "USER:3",
- "newValue": "USER:5",
- "diffValue": "diffValue"
- },
- {
- "id": 20,
- "actionId": 15,
- "attributeType": "TEXT",
- "attribute": "description",
- "attributeName": "DESCRIPTION",
- "oldValue": ""t<p>the first line</p>nt<p>the second line</p>nt<p>the 3th line</p>"",
- "newValue": ""t<p>the first line</p>nt<p>the second line</p>nt<p>the last line</p>"",
- "diffValue": "第6行变化:<br/> -:<del> the 3th line </del> <br/> +:<u> the last line </u> <br/>"
- }
- ]
- }
- ],
- "respCode": "1000"
- }
6 对象属性过滤
有些对象的属性的变动不需要进行日志记录,例如updateTime、hashCode等。ObjectLogger支持对对象的属性进行过滤,只追踪我们感兴趣的属性。
并且,对于每个属性我们可以更改其记录到ObjectLogger系统中的具体方式,例如修改命名等。
要想启用这个功能,首先将配置中的object.logger.autoLog改为false。
- object.logger.autoLog=false
然后在需要进行变化日志记录的属性上增加@LogTag注解。凡是没有增加该注解的属性在日志记录时会被自动跳过。 (编辑:西安站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|