Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "levels" working the right way #23

Open
jlescot opened this issue Jan 17, 2019 · 0 comments
Open

Make "levels" working the right way #23

jlescot opened this issue Jan 17, 2019 · 0 comments

Comments

@jlescot
Copy link
Contributor

jlescot commented Jan 17, 2019

Looking at Winston documentation about Logging levels (https://github.com/winstonjs/winston#logging-levels) and the documentation on Syslog protocol (https://fr.wikipedia.org/wiki/Syslog#Niveau_de_gravité) it seems that we are defining levels the wrong way: https://github.com/AirVantage/node-tech-logger/blob/master/techLogger.js#L18-L30

Seems that we had some troubles to set up that:

// Winston levels correctly ordered
// DO NOT TRUST Winston level definition as it does not comply to a "logical" threshold mechanism
const LEVELS_CONFIG = {
  levels: {
    emerg: 7,
    alert: 6,
    crit: 5,
    error: 4,
    warn: 3,
    notice: 2,
    info: 1,
    debug: 0
  }
};

😅

⚠️ The previous behavior has changed on Winston side since 2.x: see winstonjs/winston#406 & winstonjs/winston@438331a

So it might be an opportunity to migrate to a newer Winston version (3.x)?

At the same time, we noticed that when calling logger.warn() the message was available on Cloudwatch, but not on Loggly side... could be linked to the erratic previous behavior.
Just for information, we had to fix this bug previously, see 7af07cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant