Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@janiscommerce/log

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@janiscommerce/log

A package for creating logs in S3

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
587
increased by16.7%
Maintainers
1
Weekly downloads
 
Created
Source

log

Build Status Coverage Status

A package for creating logs in S3

Installation

npm install @janiscommerce/log

API

  • add(log, bucketName)
    Parameters: log [Object], bucketName [String]
    Puts the recieved log into the specified S3 bucket.

  • on(event, callback)
    Parameters: event [String], callback [Function] Calls a callback when the specified event is emitted.

Errors

The errors are informed with a LogError.
This object has a code that can be useful for a correct error handling.
The codes are the following:

CodeDescription
1Invalid log
2Invalid bucket
3S3 Error

In case of error while creating your log into S3, this package will emit an event called create-error, you can handle it using the on() method.

Usage

const Log = require('@janiscommerce/log');

Log.add({
	type: 1,
	entity: 'api',
	entity_id: 'product',
	message: '[GET] Request from 0.0.0.0 of custom_data'
	// ...
}, 'my-bucket');

Log.on('create-error', (log, err) => {
	console.error(`An error occurred while creating the log ${err.message}`);
});

Notes

In order to connect into S3, this package requires the aws volume in the docker-compose.yml.

volumes:
  ~/.aws:/root/.aws

FAQs

Package last updated on 07 Aug 2019

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