@norauto/log4js2-ajax-appender

An AJAX appender for log2js2 module.

Stats

StarsIssuesVersionUpdatedCreatedSize
@norauto/log4js2-ajax-appender
521.1.94 years ago4 years agoMinified + gzip package size for @norauto/log4js2-ajax-appender in KB

Readme

log4js2 AJAX appender

This module provide an AJAX appender for log4js2 module.

Build Status Coverage Status Known Vulnerabilities

Getting started

Prerequisites

You will need the following things properly installed on your computer :

Installation

This module required log4js2 and axios on your project to work. Install it and these dependencies like so :

$ npm add log4js2 axios @norauto/log4js2-ajax-appender

Usage

Create a javascript file to provide some log strategy.

import * as log4js from 'log4js2'
import { AjaxAppenderProvider } from 'log4js2-ajax-appender'


log4js.addAppender(AjaxAppenderProvider({
    method: 'POST',
    url: '/logs',
    headers: {
      'Content-Type': 'text/plain'
    }
  }))

log4js.configure({
  layout: '%d{ISO8601} [%level] %logger - %message',
  appenders: [ 'ajaxAppender' ],
  loggers: [{
    logLevel: log4js.LogLevel.WARN
  }]
})

export log4js

Here you can use the log4js to send log through AJAX requests to your log endpoint.

Development

In order to contribute and be able to start developing on the project, you will have to follow following steps :

$ git clone <repository>
$ cd <repository>
$ npm install

Running tests

  • npm run test

Building

  • npm run build

Contacts

NorautoTechLab https://twitter.com/NorautoTechLab

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.