npm config set registry https://registry.npm.taobao.org
npm config get registry
npm install -g log.io
vi log.io/config.json
{
"messageServer": {
"port": 6689,
"host": "0.0.0.0"
},
"httpServer": {
"port": 6688,
"host":"0.0.0.0"
}
}
其中 httpServer的配置 是 通过浏览器访问的地址,messageServer 是消息中心,接收客户端的日志消息。
nohup log.io-server > logio.log 2>&1 &
npm install -g log.io-file-input
vi log.io-file-input/config.json
{
"messageServer": {
"host": "127.0.0.1",
"port": 6689
},
"inputs": [
{
"source": "server-01",
"stream": "node-01",
"config": {
"path": "/usr/local/nginx/access.log"
}
}
]
}
vi /etc/profile
export LOGIO_FILE_INPUT_CONFIG_PATH="/usr/local/lib/node_modules/log.io-file-input/config.json"
source /etc/profile
nohup log.io-file-input > log.io-file-input.log 2>&1 &
日志实时显示log.io使用说明
Web实时日志输出查看管理系统
原文:https://www.cnblogs.com/wuba/p/13335032.html