{"id":42610,"date":"2016-11-30T10:16:44","date_gmt":"2016-11-30T04:46:44","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=42610"},"modified":"2016-11-30T11:37:00","modified_gmt":"2016-11-30T06:07:00","slug":"how-to-set-up-log-io","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/how-to-set-up-log-io\/","title":{"rendered":"How to set up Log.io?"},"content":{"rendered":"<p>Logs are very useful as it monitors and provides important information about the program such as activities, executions, real-time data etc.<\/p>\n<p>Log.io is a <a title=\"devops consulting\" href=\"http:\/\/www.tothenew.com\/devops-chef-puppet-docker\" target=\"_blank\">log management tool<\/a> that monitors the system and provides real-time information on the system logs. It is a simple and effective application built on top of <strong><a title=\"Node.js Consulting\" href=\"http:\/\/www.tothenew.com\/mean-node-js-development-consulting\" target=\"_blank\">Node.js<\/a>\u00a0<\/strong>and<strong> Socket.io<\/strong>. Log.io is not used to store, archive or index log messages, or provide information on the historical or aggregate analysis.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-42714 aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-banner.png\" alt=\"logio-banner\" width=\"520\" height=\"422\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-banner.png 520w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-banner-300x243.png 300w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><br \/>\nNow, let&#8217;s install Log.io and see how it works. Before the installation, let&#8217;s first understand the architecture of Log.io<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-42717 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-architecture.png\" alt=\"logio-architecture\" width=\"462\" height=\"244\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-architecture.png 462w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-architecture-300x158.png 300w\" sizes=\"(max-width: 462px) 100vw, 462px\" \/><\/p>\n<p><strong>Harvesters<\/strong>\u00a0monitors the log files and look for new changes, \u00a0sends messages about the new log files to the <strong>server<\/strong>, which are then broadcasted to the\u00a0<strong>web browsers<\/strong>. Log messages are tagged with a stream, node, and log level information based on user configuration.<\/p>\n<p>Log.io has no persistence layer i.e. file changes are informed via inotify, and log messages flow from harvester to server to web\u00a0browser via TCP and Socket.io, respectively.<\/p>\n<p><strong>Steps to install and getting started with Log.io<\/strong><\/p>\n<ol>\n<li>Install latest version of<strong>\u00a0<a title=\" Node.js development services\" href=\"http:\/\/www.tothenew.com\/mean-node-js-development-consulting\" target=\"_blank\">Node.js<\/a><\/strong>\n<p>[js]<br \/>\n\tsudo add-apt-repository ppa:chris-lea\/node<br \/>\n\tsudo apt-get update<br \/>\n\tsudo apt-get install nodejs<br \/>\n[\/js]<\/p>\n<\/li>\n<li>Install<strong> rpm<\/strong>\n<p>[js]<br \/>\ncurl -sL https:\/\/deb.nodesource.com\/setup_6.x | sudo -E bash &#8211;<br \/>\n[\/js]<\/p>\n<\/li>\n<li>Installing <strong>Log.io<\/strong>\n<p>[js]<br \/>\n\tsudo npm config set unsafe-perm true<br \/>\n\tsudo npm install -g &#8211;prefix=\/usr\/local log.io<br \/>\n[\/js]<\/p>\n<\/li>\n<li>All the files will be stored inside \/usr\/local\/lib\/node_modules\/log.io<\/li>\n<li>Now going inside ~\/.log.io directory\n<ul>\n<li>3 new conf. files would be present\n<ul>\n<li><strong>harvester.conf\u00a0<\/strong>configuring server name and log files path\n<p>[js]<br \/>\n    exports.config = {<br \/>\n  \t\t\tnodeName: &quot;application_server&quot;,<br \/>\n  \t\t\tlogStreams: {<br \/>\n    \t\t\t\tsyslogs: [&quot;\/var\/log\/syslog&quot;]<br \/>\n  \t\t\t\t},<br \/>\n  \t\t\tserver: {<br \/>\n    \t\t\t\thost: &#8216;0.0.0.0&#8217;,<br \/>\n    \t\t\t\tport: 28777<br \/>\n  \t\t\t\t}<br \/>\n\t\t}<br \/>\n    [\/js]<\/p>\n<\/li>\n<li><strong>log_server.conf<\/strong>\n<p>[js]<br \/>\n      exports.config = {<br \/>\n  \t\t\thost: &#8216;0.0.0.0&#8217;, \/\/Listens to every machine<br \/>\n  \t\t\tport: 28777<br \/>\n\t\t}<br \/>\n      [\/js]<\/p>\n<\/li>\n<li><strong>web_server.conf<\/strong>\n<p>[js]<br \/>\n    exports.config = {<br \/>\n        host: &#8216;0.0.0.0&#8217;,<br \/>\n        port: 28778,<\/p>\n<p>        \/*<br \/>\n        \/\/ Enable HTTP Basic Authentication<br \/>\n        auth: {<br \/>\n          user: &quot;admin&quot;,<br \/>\n          pass: &quot;1234&quot;<br \/>\n        },<br \/>\n        *\/<\/p>\n<p>        \/*<br \/>\n        \/\/ Enable HTTPS\/SSL<br \/>\n        ssl: {<br \/>\n          key: &#8216;\/path\/to\/privatekey.pem&#8217;,<br \/>\n          cert: &#8216;\/path\/to\/certificate.pem&#8217;<br \/>\n        },<br \/>\n        *\/<\/p>\n<p>        \/*<br \/>\n        \/\/ Restrict access to websocket (socket.io)<br \/>\n        \/\/ Uses socket.io &#8216;origins&#8217; syntax<br \/>\n        restrictSocket: &#8216;*:*&#8217;,<br \/>\n        *\/<\/p>\n<p>        \/*<br \/>\n        \/\/ Restrict access to http server (express)<br \/>\n        restrictHTTP: [<br \/>\n          &quot;192.168.29.39&quot;,<br \/>\n          &quot;10.0.*&quot;<br \/>\n        ]<br \/>\n        *\/<br \/>\n      }<br \/>\n    [\/js]<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Now we can start <strong>log.io-server and log.io-harvester<\/strong>\n<p>[js]<br \/>\nnohup\u00a0log.io-server &amp;<br \/>\nnohup\u00a0log.io-harvester &amp;<br \/>\n[\/js]<\/p>\n<\/li>\n<li>Now our log.io-server will run on 28778 and can be accessed by browsing<strong><strong> localhost:28778<\/strong><\/strong><strong><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-42728\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-example.png\" alt=\"logio example\" width=\"1301\" height=\"654\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-example.png 1301w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-example-300x150.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-example-1024x514.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/logio-example-624x313.png 624w\" sizes=\"(max-width: 1301px) 100vw, 1301px\" \/><\/strong><\/strong>The above steps\u00a0will help you to set-up a\u00a0colorful logging dashboard for real-time current logs within 5 minutes.<\/li>\n<\/ol>\n<p>Here is another blog about using <a title=\"amazon devops\" href=\"http:\/\/www.tothenew.com\/blog\/amazon-elasticsearch-for-centralized-log-management\/\" target=\"_blank\">Amazon Elasticsearch with Amazon Cloudwatch to setup centralized logs<\/a>, which can be done by using Amazon ElasticSearch and CloudWatch services.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Logs are very useful as it monitors and provides important information about the program such as activities, executions, real-time data etc. Log.io is a log management tool that monitors the system and provides real-time information on the system logs. It is a simple and effective application built on top of Node.js\u00a0and Socket.io. Log.io is not [&hellip;]<\/p>\n","protected":false},"author":919,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":39},"categories":[1174,2348,1185,1],"tags":[4246,1892,4261,4247,288,1782,1124,4245,4258],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/42610"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/919"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=42610"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/42610\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=42610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=42610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=42610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}