0.5.0 • Published 9 years ago

myseat-logger v0.5.0

Weekly downloads
35
License
MIT
Repository
github
Last release
9 years ago

myseat-logger

a chainable node.js logger module for internal system

this project will be deprecated. see maizuo-fe/node-mog.

Install

npm install myseat-logger

Get Started

var myseatLogger = require('myseat-logger');
myseatLogger.config({
  filePath: '/path/to/file.log',
  device: 'myNewApp'
});
var Logger = myseatLogger.Logger;
var logger = new Logger();
logger.to(25);
logger.interface('/internal');
logger.done();

Example

simple

code:

var Logger = require('myseat-logger').Logger;
Logger().to(25).interface('/internal').param('uid=1&keyword=foobar').message('well').done();

output:

{"@source":"192.168.1.101","@fields":{"fromType":"myApp","toType":"myApp","@totype":25,"@interface":"/internal","@param":"uid=1&keyword=foobar"},"@message":"well","@timestamp":"2014-03-03T12:48:19+08:00"}

Config

call require('myseat-logger').config when you are launching the app.

var log = require('myseat-logger');
log.config({
  filePath: '/path/to/file.log',
  device: 'myNewApp'
});

config.filePath

the logs will be sent to this file

config.device

it is the current device name, which is the default value for to/from

config.prefix

prefix of interface

config.maxlength

maxlength of each field

API

Logger

todo

LogFile

todo

License

The MIT License (MIT)

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.0

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago