Giter VIP home page Giter VIP logo

bunyan-seq's People

Contributors

dependabot[bot] avatar larenelg avatar liammclennan avatar nblumhardt avatar ngbrown avatar spragalas avatar tsimbalar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bunyan-seq's Issues

onError doesn't properly handle errors

This issue has crashed my server and set me back a few hours.

The function you pass into onError property of SeqConfig (createStream method argument) gets called on an error, but at the same time another error is being emitted by the SeqStream which is not handled.

To alleviate that, you need to setup your logger as follows:

const streams = []
const seqStream = bunyanSeq.createStream({
    serverUrl: 'http://X.Y.Z.W',
    level: 'info',
    apiKey: 'ABCDE',
    onError: (e: Error) => { 
        console.trace('Logging failed:', e);
   }
})

seqStream.stream.on('error', (e) => console.trace('Now this is what I call error!',e)) // This is the important line
streams.push(seqStream)

let log: any = bunyan.createLogger({
  name: 'myAwesomeLogger',
  streams: streams
})

If you don't do that, any error that arises from stream misconfiguration or (as happened to me) from an outage of the logging server, will crash your app.

ES5 build

Hi,

Is there any chance to have the published packages be in ES5 instead of ES6?

The reason being that UglifyJs doesn't support ES6 yet, and being in a TS project we find bringing in Babel just to compile a dependency a bit too much.

Thanks

Retry failed batches

Currently, batches of log events that cannot be sent to Seq for any reason will be dropped.

If the returned status code from the HTTP request indicates that the server is down (0) or unavailable (503) then some number of retries should be attempted.

Typescript error when building application

I get a TS build error with index.d.ts file in library. "npm run build" command

"index.d.ts:11:12 - error TS2503: Cannot find namespace 'config'."
"level: config.level;"

I resolved by adding a "// @ts-nocheck" at the top of file. Do you have or working on a better solution? Can you add this temp fix to library in Git?

Seq stream mutates event object

Seq stream mutates event object thus event object cannot be used in following streams because it is missing required data.
File: bunyan-seq/seq_stream.js
Lines: 49-52

I suppose these lines must be removed. Is there any good reason to delete these properties?

Reproduce:

var log = bunyan.createLogger({
    name: 'myapp',
    streams: [
        seq.createStream({
            serverUrl: 'http://localhost:5341',
            level: 'info'
        }),
        {
            stream: process.stdout,
            level: 'warn',
        }
    ]
});
log.info('Hi!');

This does not log msg: "Hi" to stdout

Electron - Uglify Issues

Hi there

We're using bunyan and bunyan-seq in an electron renderer process (a Chromium browser window). Since this is electron, we are able to access node APIs. However, to reduce bundle sizes, we are Ugilfying.

However, we're tripped up in this library as it, and rightfully so, uses ES6 constructs like let. This means that UgilfyJS doesn't work as it doesn't support ES6 yet.

I was wondering if anyone had some ideas, I'm not convinced this library should change because of other tool's deficiencies.

Error in Shipping Stops all logging

If for any reason an error occurs while shipping, all logging stops happening. This is because bunyan-seq, when constructing the logger, emits an 'error' event on the EventEmitter. If there are no subscribers to this by default, it just throws. Which stops everything else working.

loggerConfig.onError = (e) => {
            this.emit('error', e);
            onError(e);
        };        

No Seq Logging seen

Hi there

I've configured bunyan with three stream. A console stream, a file stream and a bunyan-seq stream. I'm seeing the console logs and the file stream log, but nothing is being logged to seq.

Nothing is being logged to the console for the onError handler, and no traffic is leaving the client (verified with Wireshark). What else can I do to debug this issue?

sample config:

seq.createStream({
            serverUrl: 'http://seq:5432',
            apiKey: 'APIKEY,
            level: 'debug' 
});

README: Updating default branch of local clones to `main` from 17 Jun, 2020

If you have a fork or local clone from before 17 June 2020, you will need to run the following commands to update your forked/cloned repo.

git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
//if fork: git push -u origin main
git branch -u origin/main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main

You will also need to change your default branch in GitHub settings

In repo settings, select "Branches" in menu, and change master to main branch and update

And, finally, delete master in /branches:

In repo branches page, there is a delete icon to the right of the master row

Report an error in Typescript

const log = bunyan.createLogger({
  name: 'card-service',
  streams: [
    {
      stream: process.stdout,
      level: 'warn',
    },
    seq.createStream({
      serverUrl: 'http://localhost:5341',
      level: 'info',
    }),
  ],
});

WX20210629-194451@2x

why is npm a primary dependancy?

When depending on this package, it seems to be pulling in npm since it's listed as a dependency. It was added in commit dbc2241.

If it really is needed for the mocha package, then it should be in the devDependencies section. That way it won't be pulled in on packages that are just using bunyan-seq.

MaxListenersExceededWarning

I have a background service that runs forever in a loop, while sleeping for x (10-20) seconds while there is nothing to be processed.

When logging something on each iteration, after some minutes (sometimes after seconds, depending on the sleep time), i get the warning:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 timeout listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit

The warning does not appear when removing the seq stream and just using a local debug stream for example.

My question is, is this known/intended, or am I using something incorrectly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.