petershaw / told-nodejs-client

A client to log messates into a told log recorder.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

told-nodejs-client

Build Status NPM version

A client to log messates into a told log recorder. See https://github.com/petershaw/told-LogRecorder to kern more about told.

Description

Sends a message to the server. Noting more, nothing less.

Usage

var told = require('told-client-js')(opts);
told.tell("A Test Message", "Error", "Connection,Database");

or

var told = require('told-client-js')(opts);
message = {
	myKey_1: "foo"
	, myKey_2: "bar"
};
type = "Error";
tags = ["Connection", "Database"];
told.tell(message, type, tags);

and of course you can use it as one big Object:

var told = require('told-client-js')(opts);
paylaod = {
	message: {
		myKey_1: "foo"
		, myKey_2: "bar"
	}
	, type: "Error"
	, tags: [
		"Connection"
		, "Database"
	]
};
told.tell(paylaod);

Configuration

You HAVE TO set a url to your told server.

opts = {
	url: 'http://told.mydomain.com'
}

����� Additional you can set one of this default options:

To set a fixed type, if no other is set by the call itself:

opts.type = "myApplication"

To add some default tags. These tags will be send ALWAYS right next to the tags that are send by the call it self:

opts.tags = ["beutiful", "catcontent"]

To set some default tags could be overwritten by the call:

opts.defaultags = ["unspecific error"]

Protokoll:

As default, this client use http POST over tcp ip. If you want to use UDP dgram packages instead, than you have to wait for the next Version.

About

A client to log messates into a told log recorder.


Languages

Language:JavaScript 100.0%