GithubHelp home page GithubHelp logo

hyeongukryu / fluent-logger-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fluent/fluent-logger-node

0.0 2.0 0.0 227 KB

A structured logger for Fluentd (Node.js)

License: Apache License 2.0

fluent-logger-node's Introduction

fluent-logger for node.js

fluent-logger implementation for node.js inspired by fluent-logger-python.

Build Status

Install

$ npm install fluent-logger

Prerequistes

Fluent daemon should listen on TCP port.

Usage

Send an event record to fluentd

Singleton style

var logger = require('fluent-logger')
// The 2nd argument can be omitted. Here is a defualt value for options.
logger.configure('tag', {
   host: 'localhost',  
   port: 24224,
   timeout: 3.0
});

// send an event record with 'tag.label'
logger.emit('label', {record: 'this is a log'});

Instance style

var logger = require('fluent-logger').createFluentSender('tag', {
   host: 'localhost',  
   port: 24224,
   timeout: 3.0
});

The emit method has following signature

.emit([label string], , [timestamp number/date], [callback function])

Where only the record argument is required. If the label is set it will be appended to the configured tag.

Logging Library Support

log4js

Befre using [log4js] support, you should install it IN YOUR APPLICATION.

var log4js = require('log4js');
log4js.addAppender(require('fluent-logger').support.log4jsAppender('mytag', {
   host: 'localhost',
   port: 24224,
   timeout: 3.0
}));

var logger = log4js.getLogger('foo');
logger.info('this log record is sent to fluent daemon');

License

Apache License, Version 2.0.

fluent-logger-node's People

Contributors

esamattis avatar jbarreneche avatar nak2k avatar piroor avatar yssk22 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.