@norauto/log4js2-ajax-appender
TypeScript icon, indicating that this package has built-in type declarations

1.1.9 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @norauto/log4js2-ajax-appender

Weekly Downloads

0

Version

1.1.9

License

MIT

Unpacked Size

16.7 kB

Total Files

10

Last publish

Collaborators

  • tverhoken