log_monitor
A command line tool and library to monitor node server logs in real time.
Last updated 2 years ago by erwidman .
ISC · Original npm · Tarball · package.json
$ cnpm install log_monitor -g
SYNC missed versions from official npm registry.

An API and CLI for remote node server monitoring, includes text coloring capabilities.

Monitor stdout and stderr while highlighting important information remotely.

Installation


	npm install -g log_monitor			

##Usage

###Opening and closing a port for remote monitoring


	const logServer = require("log_monitor");
	
	logServer.openLog(8000)
	.then(()=>{
		//handle open
	})	
	.catch((err)=>{
		//handle error
	});

	logServer.closeLog()			
	.then(()=>{
		//handle close
	})
	.catch((err)=>{
		//handle error
	});

###Connecting to an open port from command line


	log_monitor connect 8.8.8.8 8000	

###Linking a color specification:

color.json


	{
		"ERROR:[0-9]" : {
			"fg" :"#343434",
			"bg" : "#FF4444",		
			"style" : "bold"
		},
		"CREDIT CARD READER" : {
			"fg" : "#808000",
			"style" : "underline"
		}
	}

invocation


	log_monitor connect 8.8.8.8 8000 --color color.json			

Imgur

##Events

socket_open
        socket : A net.Socket Object of connected TCP Socket socket docs

socket_closed
        socket : A net.Socket Object of connected TCP Socket socket docs

socket_data
        socket : A net.Socket Object of connected TCP Socket socket docs
        data: A byte buffer containing data sent by above socket

socket_error
        socket : A net.Socket Object of connected TCP Socket socket docs
        err: Some error

server_error.
        err : Some error


	const logServer = require("log_monitor");	

	logServer.on("socket_opened",(socket)=>{
		//handle connection
	});

	logServer.on("socket_closed",(socket)=>{
		//handle disconnect
	});

	logServer.on("socket_data",(socket,data)=>{
		//handle socket data
	});

	logServer.on("socket_error",(socket,err)=>{
		//handle error
	});

	logServer.on("server_error",(err)=>{
		//handle server error
	});


##DOCS

require("log_monitor").openLog(port)
   Description:
        Opens a TCP server on the input port for API.
   Arguments:
        port : Desired port number for log server.
   Return:
        A promise that resolves when the TCP server is successfully instantiated.

require("log_monitor").closeLog()
   Description:
        Closes TCP server opened by call to openLog - fails if server has not been open.
   Arguments:
        N/A
   Return:
        A promise that resolves when the TCP server is successfully closed.

Current Tags

  • 1.4.8                                ...           latest (2 years ago)

41 Versions

  • 1.4.8                                ...           2 years ago
  • 1.4.7                                ...           2 years ago
  • 1.4.6                                ...           2 years ago
  • 1.4.5                                ...           2 years ago
  • 1.4.4                                ...           2 years ago
  • 1.4.2                                ...           2 years ago
  • 1.4.1                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.14                                ...           2 years ago
  • 1.2.13                                ...           2 years ago
  • 1.2.12                                ...           2 years ago
  • 1.2.11                                ...           2 years ago
  • 1.2.10                                ...           2 years ago
  • 1.2.9                                ...           2 years ago
  • 1.2.8                                ...           2 years ago
  • 1.2.7                                ...           2 years ago
  • 1.2.6                                ...           2 years ago
  • 1.2.5                                ...           2 years ago
  • 1.2.4                                ...           2 years ago
  • 1.2.3                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.0.17                                ...           2 years ago
  • 1.0.16                                ...           2 years ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           2 years ago
  • 1.0.12                                ...           2 years ago
  • 1.0.11                                ...           2 years ago
  • 1.0.10                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |