<commit_before>send-logentries
===============

Send logs to logentries with a name instead of token and expose a basic functions to use with your logs.

## Installation

	npm install send-logentries --save

## Usage

The basic use to add to your application:

```javascript
var sl = require('send-logentries'),
	log = sl.init('app-test');
```

The variable `log` should have the same as logentries module when you put the token.

If you like, you can use other basic functions to use in your code.

With express:

```javascript
var express = require('express');

var app = express();

app.use(responseTime());
```

`responseTime()` function should use before other routes or put in the position that you desire to measure. This function send logs automatically to logentries with the format:

```javascript
{
	route: req.route.path,
	host: req.headers.host,
	statusCode: res.statusCode,
	TotalTime: time,
	unit: 'ms'
}
```

If you need to treat or process other information, its possible to pass a callback function and receive the time elapsed for a concrete request:

```javascript
app.use(sl.responseTime(function (time) {
	console.log('TIME: ', time);
	console.log({ Time: time, unit: 'ms' });
	log.info( { Time: time, unit: 'ms' } );
}));
```

You can measure time for your async functions:

```javascript
var idTimeStamp = sl.start();

setTimeout(function() {
	var elapsedNano = sl.end(idTimeStamp);
	var elapsedMilli = elapsedNano / 1000000; // divide by a million to get nano to milli

	console.log('Time(ms): ', elapsedMilli);
	log.info( { Time: elapsedMilli, unit: 'ms' } );
}, 5000);
```

When you run your application, you need to add a enviroment var to use (depends on your system) with the name: LE_TOKENS and represents a json file with an object with tuples of name/token:

```javascript
{
	"default":
	{
		"token": "<token_value>"
	},
	"name":
	{
		"token": "<token_value>"
	}
}
```

An example in unix systems:

```sh
 LE_TOKENS=path/to/file.json node yourapp.js
```

## Tests

  npm test

## Contributing

  TODO

## Release History

* 0.0.1 Initial release<commit_msg>Update README file with new tags<commit_after>send-logentries
===============

Send logs to logentries with a name instead of token and expose a basic functions to use with your logs.

## Installation

```sh
 npm install send-logentries --save
```

## Usage

The basic use to add to your application:

```javascript
var sl = require('send-logentries'),
	log = sl.init('app-test');
```

The variable `log` should have the same as logentries module when you put the token.

If you like, you can use other basic functions to use in your code.

With express:

```javascript
var express = require('express');

var app = express();

app.use(responseTime());
```

`responseTime()` function should use before other routes or put in the position that you desire to measure. This function send logs automatically to logentries with the format:

```javascript
{
	route: req.route.path,
	host: req.headers.host,
	statusCode: res.statusCode,
	TotalTime: time,
	unit: 'ms'
}
```

If you need to treat or process other information, its possible to pass a callback function and receive the time elapsed for a concrete request:

```javascript
app.use(sl.responseTime(function (time) {
	console.log('TIME: ', time);
	console.log({ Time: time, unit: 'ms' });
	log.info( { Time: time, unit: 'ms' } );
}));
```

You can measure time for your async functions:

```javascript
var idTimeStamp = sl.start();

setTimeout(function() {
	var elapsedNano = sl.end(idTimeStamp);
	var elapsedMilli = elapsedNano / 1000000; // divide by a million to get nano to milli

	console.log('Time(ms): ', elapsedMilli);
	log.info( { Time: elapsedMilli, unit: 'ms' } );
}, 5000);
```

When you run your application, you need to add a enviroment var to use (depends on your system) with the name: LE_TOKENS and represents a json file with an object with tuples of name/token:

```javascript
{
	"default":
	{
		"token": "<token_value>"
	},
	"name":
	{
		"token": "<token_value>"
	}
}
```

An example in unix systems:

```sh
 LE_TOKENS=path/to/file.json node yourapp.js
```

## Tests

```sh
 npm test
```

## Contributing

  TODO

## Release History

* 0.0.1 Initial release
{'fraction_non_alphanumeric': 0.12944523470839261, 'fraction_numerical': 0.006638217164532954, 'mean_word_length': 4.306918238993711, 'pattern_counts': {'":': 8, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6552817', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1306, 'n_words': 516}