• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
梧桐爱凤
博客园    首页    新随笔    联系   管理    订阅  订阅

[批处理]使用Log.io监控日志变化

背景

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

方案

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

每多学一点知识,就少写一行代码
posted @ 2019-03-29 17:58  梧桐爱凤  阅读(799)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3