JSPM

log4js-fluent-appender

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 245
    • Score
      100M100P100Q95934F
    • License Apache-2.0

    Custom appender for log4js based on fluent-logger

    Package Exports

    • log4js-fluent-appender

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (log4js-fluent-appender) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    log4js appender for fluent-logger

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

    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:

    License

    Apache License, Version 2.0.