多台服务器安装了不同的开发服务,增加日志监控以随时处理情况

方案

log.io

环境

NodeJs

安装

1、log.io直接无法安装上,使用log.io-ts安装上

npm install -g log.io-ts

 


::切换到taobao镜像,否则执行特别慢
2、从https://github.com/NarrativeScience/Log.io下载Log.io-master.zip,解压到路径 AppData\Roaming\npm\node_modules下,并更名为log.io

npm config set registry https://registry.npm.taobao.org
npm install winston -g
::启动服务器
log.io.cmd start-server --pwd xxx --port 8000

 

3、编写Json文件指定监控文件

[
    {
        "node": "gmjtest1-pc-error",
        "path": "C:/Users/xxx/.pm2/logs/error.log"
    },
    {
        "node": "gmjtest1-pc-out",
        "path": "C:/Users/xxx/.pm2/logs/out.log"
    }
]

 

4、启动客户端

::启动客户端
log.io.cmd start-client -s http://xxx:8000 -c  log-config.json

5、浏览器访问

http://localhost:8000/?password=xxx

参考资料

https://github.com/xialeistudio/log.io-ts/

https://github.com/NarrativeScience/Log.io

http://www.phperz.com/article/17/0509/274779.html

http://www.qingpingshan.com/jb/javascript/333967.html

相关文章:

  • 2021-12-29
  • 2021-06-07
  • 2022-12-23
  • 2022-03-05
  • 2021-08-24
  • 2021-11-28
  • 2021-09-02
猜你喜欢
  • 2021-12-09
  • 2021-11-29
  • 2022-12-23
  • 2021-06-18
  • 2021-12-03
  • 2021-12-25
相关资源
相似解决方案