第一步:安装服务端
1、npm install -g log.io
2、在/root/.log.io目录下创建server.json文件
vi server.json
{
"messageServer": {
"port": 6689,
"host": "127.0.0.1"
},
"httpServer": {
"port": 6688,
"host": "127.0.0.1"
},
"debug": false,
"basicAuth": {
"realm": "abc123xyz",
"users": {
"admin": "123456"
}
}
}
备注:127.0.0.1需要修改为本机ip地址
3、log.io-server #启动服务器
4、访问地址:http://localhost:6688
第二步:安装客户端
1、npm install -g log.io-file-input
2、在/root/.log.io/inputs目录下创建file.json文件
vi file.json
{
"messageServer": {
"host": "127.0.0.1",
"port": 6689
},
"inputs": [
{
"source": "demo-info",
"stream": "demo-service",
"config": {
"path": "/home/jar/logs/demo-info.log"
}
},
{
"source": "demo-error",
"stream": "demo-service",
"config": {
"path": "/home/jar/logs/demo-error.log"
}
}
]
}
备注:127.0.0.1需要修改为本机ip地址
3、log.io-file-input #启动客户端