node.js用logio实时监控log

http://logio.org/

 

1、先装好node.js

$ yum install nodejs

 

2、安装log.io

$sudo npm install -g log.io --user "root"

 

3、启动log.io server

$nohup log.io-server &

 

4、修改配置文件

vim ~/.log.io/harvester.conf

exports.config = {
    nodeName: "application_server",
    logStreams: {
      apache: [
        "/var/log/apache2/access.log",
        "/var/log/apache2/error.log"
      ]
    },
    server: {
      host: '0.0.0.0',
      port: 28777
    }
  } 

修改.log目录

 

5、启动log.io客户端

$ nohup log.io-harvester &

 

6、浏览器查看

http://localhost:28778

 

发现那两个启动命令会出现ssh终端退出进程就自动关闭,可以用这两个命令
sudo nohup node /bin/log.io-server &
sudo nohup node /bin/log.io-harvester &




 

posted @ 2018-05-16 14:40  MrBlue  阅读(698)  评论(0编辑  收藏  举报