How to Setup Log.io For Multi Server Log Monitoring

Posted By : Jatin Gupta | 28-Jan-2018

Logs are extremely valuable as it screens and gives vital data about the program, for example activites, executions, ongoing information
and so forth.

What is log.io ?

Log.io is a log management tool that monitors the system and provides real-time information of the logs. It is a simple and effective application
built on top of Node.js and Socket.io. Log.io is not used to store or analyse logs, it is just a UI provided for viewing logs.

How does log.io work ?

There are 3 components of a log.io server : 

1. Harvester : It monitors the log files and look for new changes, send messages about the new log files

2. Log Server : Listens to one or more harvester for logs.

3. Web Server : Broadcast the logs on the web UI tagged with a stream node and log level information based on user configuration.

 

How to setup log.io for multi server logs ?

Setting up log.io as a centralised server for viewing logs of the application, web server, database, system logs etc can prove very
helpful for the development team. They can just sign in to the log.io console to view the logs.

Let's get started,
Suppose you have 3 servers,

one for log.io
one server on which the webserver (nginx for this case) is running
one server on which the application (tomcat for this case) is running.

For configuring log.io to see all logs including web server and application logs, we have to install log.io on each server.

To install log.io you need node and npm,
To install node and npm,

 $ sudo apt-get update
 $ sudo apt-get install nodejs  
 $ sudo apt-get install npm

Now install log.io on each server using :

 $ npm install -g log.io –user “root”

>> On master server (i.e log.io server, ex IP : 10.0.1.10) run,

 $ nohup log.io-server &
 $ nohup log.io-harvester &

>> On web server (ex IP : 10.0.2.10),

edit the harvester.conf using
 $ vim ~/.log.io/harvester.conf  


exports.config = {
  nodeName: "web_server",
  logStreams: {
    application: [
      "/var/log/nginx/access.log"
   ],
  },
  server: {
    host: '10.0.1.10',
    port: 28777
  }
}

                 		

start the harvester by running,
 $ nohup log.io-harvester &

>> On application server (ex IP : 10.0.3.10),

edit the harvester.conf
 $ vim ~/.log.io/harvester.conf 


exports.config = {
  nodeName: "application_server",
  logStreams: {
    application: [
      "/opt/tomcat/logs/catalina.out"
   ],
  },
  server: {
    host: '10.0.1.10',
    port: 28777
  }
}

start the harvester by running,
$ nohup log.io-harvester &

 

>> The setup of log.io is completed, now in browser enter the ip of log.io server "10.0.1.10:28778" and see the real time logs of application
and web server in browser.
 

About Author

Author Image
Jatin Gupta

Jatin is a DevOps trainee. He ha deep interest in python and cloud technologies. He likes to read about science/history and fiction, listening to music and explore new places.

Request for Proposal

Name is required

Comment is required

Sending message..