mirror of
https://github.com/steedos/steedos-platform
synced 2024-11-23 17:42:48 +00:00
fix [Feature]: 新增系统日志表(logs),软件包可以主动记录日志(错误、警告、信息) #6571
This commit is contained in:
parent
d4724f9b2f
commit
80aca3e2ad
1
.gitignore
vendored
1
.gitignore
vendored
@ -29,6 +29,7 @@
|
||||
!/server/bundle/**/node_modules/formBuilder/dist
|
||||
!/server/bundle/**/node_modules/@steedos/form-builder/dist
|
||||
!/server/bundle/**/node_modules
|
||||
!services/standard-space/main/default/objects/logs
|
||||
docker-volumes/**
|
||||
examples/multi-node-testing/**
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: sunhaolin@hotoa.com
|
||||
* @Date: 2023-03-23 15:12:14
|
||||
* @LastEditors: 孙浩林 sunhaolin@steedos.com
|
||||
* @LastEditTime: 2023-11-14 10:27:19
|
||||
* @LastEditors: baozhoutao@steedos.com
|
||||
* @LastEditTime: 2024-03-10 14:28:36
|
||||
* @Description:
|
||||
*/
|
||||
"use strict";
|
||||
@ -407,8 +407,45 @@ module.exports = {
|
||||
async handler() {
|
||||
return await this.broker.call("objectql.makeNewID")
|
||||
}
|
||||
},
|
||||
getLog: {
|
||||
handler: function () {
|
||||
return {
|
||||
debug: async function(message, details){
|
||||
return await this.getObject('logs').directInsert({
|
||||
'level': 'debug',
|
||||
'name': message,
|
||||
'details': details,
|
||||
'node_id': this.broker.nodeID
|
||||
})
|
||||
},
|
||||
info: async function(message, details){
|
||||
return await this.getObject('logs').directInsert({
|
||||
'level': 'info',
|
||||
'name': message,
|
||||
'details': details,
|
||||
'node_id': this.broker.nodeID
|
||||
})
|
||||
},
|
||||
warn: async function(message, details){
|
||||
return await this.getObject('logs').directInsert({
|
||||
'level': 'warn',
|
||||
'name': message,
|
||||
'details': details,
|
||||
'node_id': this.broker.nodeID
|
||||
})
|
||||
},
|
||||
error: async function(message, details){
|
||||
return await this.getObject('logs').directInsert({
|
||||
'level': 'error',
|
||||
'name': message,
|
||||
'details': details,
|
||||
'node_id': this.broker.nodeID
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,5 @@
|
||||
name: details
|
||||
type: code
|
||||
language: ini
|
||||
is_wide: true
|
||||
sort_no: 200
|
@ -0,0 +1,3 @@
|
||||
name: level
|
||||
type: text
|
||||
sort_no: 120
|
@ -0,0 +1,3 @@
|
||||
name: name
|
||||
type: text
|
||||
sort_no: 100
|
@ -0,0 +1,2 @@
|
||||
name: node_id
|
||||
type: text
|
@ -0,0 +1 @@
|
||||
name: logs
|
Loading…
Reference in New Issue
Block a user