1.0.1 • Published 7 years ago

http-apikey-transport v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

Http Apikey Transorte

This is a transport http and https for winston whit authorization by apikey. It is a transport only for send logs.

Example

const winston = require('winston')
const HttpTransporte = require('http-apikey-transport')
const logger = new (winston.Logger)({
  rewriters: [],
  transports: [
    new HttpTransporte({
      uri: "http://it-is-your-api-route/logs",
      apikey: "thi is the apikey value",
      service: "It is a identifier"
    })
  ]
})
logger.info('Hello world', { anything: 'This is metadata' });
logger.warn('Warning message', { anything: 'This is metadata' });
logger.debug('Debugging info', { anything: 'This is metadata' });
logger.error('Error test', { anything: 'This is metadata' });

The transport will send the data by POST method with the following format:

{
    "service": "It is a identifier",
    "level": "info",
    "message": "Hello world",
    "meta": {
        "anything": "This is metadata"
    }
}