Socket
Socket
Sign inDemoInstall

log4js-fluent-appender

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log4js-fluent-appender

Custom appender for log4js based on fluent-logger


Version published
Weekly downloads
223
decreased by-24.66%
Maintainers
1
Weekly downloads
 
Created
Source

log4js appender for fluent-logger

This package provides log4js-node appender for fluent-logger.

NPM

Build Status

Install

$ npm install log4js-fluent-appender

Prerequistes

Fluent daemon should listen on TCP port.

Simple configuration is following:

<source>
  @type forward
  port 24224
</source>

<match **.*>
  @type stdout
</match>

Usage

const log4js = require('log4js');

log4js.configure({
  appenders: {
    fluent: {
      type: 'log4js-fluent-appender',
      tag_prefix: 'tag_prefix',
      options: {
        levelTag: true,
        host: 'localhost',
        port: 24224
      }
    }
  },
  categories: {
    default: {
      appenders: ['fluent'],
      level: 'info'
    }
  }
});

const logger = log4js.getLogger();

logger.info('This is info message!');

setTimeout(() => {
  log4js.shutdown(() => {});
}, 1000);

See also:

Events

const log4js = require('log4js');

const fluentAppender = log4js.configure({
  appenders: {
    fluent: {
      type: 'log4js-fluent-appender',
      tag_prefix: 'tag_prefix',
      options: {
        levelTag: true,
        host: 'localhost',
        port: 24224
      }
    }
  },
  categories: {
    default: {
      appenders: ['fluent'],
      level: 'info'
    }
  }
});

fluentAppender.on('connect', () => {
  console.log('connect event!');
});
fluentAppender.on('error', (error) => {
  console.log('error occured!');
});

Options

levelTag

If false, tag is "mytag". Otherwise tag is "mytag.INFO". If you want to omit level tag such as .INFO, you must specify this value to false.

See fluent-logger.

License

Apache License, Version 2.0.

Keywords

FAQs

Package last updated on 06 Dec 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc