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

fwsp-logger

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fwsp-logger - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

lib/esTransport.js

28

lib/HydraLogger.js

@@ -7,3 +7,5 @@ 'use strict';

const hydraOpts = (opts, hydra) => {
let augment = {serviceName: opts.serviceName};
let augment = {
serviceName: opts.serviceName
};
if (opts.augment) {

@@ -55,9 +57,5 @@ opts.augment = Object.assign(opts.augment, augment);

initLogger() {
this._logger = new HydraPinoLogger(
Object.assign(
{serviceName: this.hydraConfig.serviceName},
this.opts
),
this.hydra
);
this._logger = new HydraPinoLogger(Object.assign({
serviceName: this.hydraConfig.serviceName
}, this.opts), this.hydra);
}

@@ -75,14 +73,4 @@ /**

onServiceReady() {
this.hydra.on('log', entry => {
if (typeof(entry.msg) === 'object') {
const entryObj = entry.msg;
entry.msg = entryObj.message ? entryObj.message : JSON.stringify(entryObj);
if (entryObj.stack) {
entry.stack = entryObj.stack;
}
}
this._logger.pino[entry.type](entry);
});
this.hydra.on('log', entry =>
this._logger.pino[entry.type.toLowerCase()](entry));
}

@@ -89,0 +77,0 @@ }

'use strict';
const pino = require('pino');
const spawn = require('cross-spawn');
const fork = require('child_process').fork;
const PassThrough = require('stream').PassThrough;

@@ -166,7 +166,4 @@ const fs = require('fs');

initTransport(es) {
let args = es ? ['-H', es.host, '-p', es.port] : null;
if (es.index) {
args.push('-i', es.index);
}
this.esTransport = spawn('pino-elasticsearch', args);
this.esTransport = fork(`${__dirname}/esTransport`, { silent: true });
this.esTransport.send(es);
this.esTransport.on('error', err => {

@@ -173,0 +170,0 @@ throw new Error(`Failed to start pino-elasticsearch: ${err}`);

{
"name": "fwsp-logger",
"version": "0.2.2",
"version": "0.2.3",
"author": {

@@ -24,13 +24,13 @@ "name": "Eric Adum",

"chokidar": "1.7.0",
"cross-spawn": "5.1.0",
"hydra-express-plugin": "0.0.1",
"hydra-plugin": "0.0.1",
"lodash": "4.17.4",
"pino": "4.5.2",
"pino": "4.5.3",
"pino-elasticsearch": "2.0.1",
"pino-http": "2.6.1"
},
"devDependencies": {
"chai": "3.5.0",
"chai": "4.0.0",
"eslint": "3.19.0",
"mocha": "3.3.0"
"mocha": "3.4.2"
},

@@ -37,0 +37,0 @@ "bin": {

Sorry, the diff of this file is not supported yet

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