Socket
Book a DemoInstallSign in
Socket

forwardho

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forwardho

forward log data from a bunch of watched log files over the network with a simple json protocol

latest
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

Build Status

forwardho

Tails a file. it should work great. it will continue to work even if a file is unlinked rotated or truncated. It is also ok if the path doesnt exist before watching it

Example

if you install globally you will get forwardho as a command it accepts options as arguments or reads them from the most local forwardho.json

$> forwardho

as a library


var forwardho = require('forwardho'),
client = forwardho({host:'localhost',port:5140,logs:['/var/log/some.log','/var/log/someother.log']});

to shutdown

client.close();
,,,
## install

	npm install -g forwardho

### library argument structure

client = forwardho(options);


- options. supported custom options are

	```js
	{
	  "logs":[],
	  "host":"localhost",
	  "port":5140,
	  "keepAlive":true,
	  "keepAliveInterval":10000,
	  "reconnectInitialTimeout":100,
	  "reconnectMaxInterval":30000,
	  "tailOptions":{}
	}

	where tailOptions can be the following  tailfd options. right now tail options are always applied to all logs watched by this client.
	{

	"delimiter":"\n"
	//optional. defaults to newline but can be anything

	}

	// the options object is passed to watchfd as well. With watchfd you may configure

	{

	"timeout": 60*60*1000, //defaults to one hour
	//how long an inactive file descriptor can remain inactive before being cleared

	"timeoutInterval":60*5*1000 //every five minutes
	// how often to check for inactive file descriptors

	}

	//the options object is also passed directly to fs.watch and fs.watchFile so you may configure

	{
	"persistent":true, //defaults to true
	//persistent indicates whether the process should continue to run as long as files are being watched

	"interval":0, //defaults 0
	//interval indicates how often the target should be polled, in milliseconds. (On Linux systems with inotify, interval is ignored.) 
	}
	```



#### watch file and watch may behave differently on different systems here is the doc for it.

- http://nodejs.org/api/fs.html#fs_fs_writefile_filename_data_encoding_callback
- http://nodejs.org/api/fs.html#fs_fs_watch_filename_options_listener

FAQs

Package last updated on 24 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts