wt-console-server is an open source log manager backend which can be private deployed.
Install nodemon
if not.
npm install nodemon -g
npm install babel-node -g
git clone https://github.com/UnPourTous/wt-console-server.git
cd wt-console-server
yarn
// babel-node will be used
// setup dev directly
npm run dev
// or use pm2
pm2 start ./scripts/setup.sh --name wt-console-server
First, you should know the format of a single log. then put it in to the upload body.
key | require/option | type | description |
---|---|---|---|
ts | require | String | Timestamp in ms |
msg | require | String | Log content, all log should be converted to string before upload |
tags | option | Array | custom types defined for this log, we have some predefined tags ['ERROR', 'WARN', 'INFO'] |
A valid upload request should be like this
curl -X POST \
http://localhost:3000/v1/log \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 100cd87e-131b-c4d9-e17f-69b1740ded59' \
-d '{
"logList": [
{
"ts": "1495063513667",
"msg": "log content, json or object should be convert to string"
},
{
"ts": "1495063513667",
"msg": "log content, json or object should be convert to string"
}
]
}'
The corresponding response which contain the log id we need.
{
id: '520'
}
Then you can use this log id to get your uploaded log at http://yourhostname:3000/#!/logviewer/520
TODO