pino icon indicating copy to clipboard operation
pino copied to clipboard

Syslog severity level

Open cojack opened this issue 4 years ago • 4 comments

Hi, I would like to implement syslog severity level as follows:

var pino = require("pino");
  
const customLevels = {
  emerg: 0,
  alert: 1,
  crit: 2,
  err: 3,
  warning: 4,
  notice: 5,
  info: 6,
  debug: 7
};

const logger = pino({ customLevels, useOnlyCustomLevels: true, level: 'debug' });

logger.alert('wooo');

But then this log is not presented, why?

cojack avatar Apr 12 '21 13:04 cojack

I would set some breakpoints in https://github.com/pinojs/pino/blob/0a56154fa0a24ac2b4015b597e6ae06468821699/lib/levels.js to determine the cause.

But I'd also ask if using https://github.com/pinojs/pino-syslog is not possible.

jsumners avatar Apr 12 '21 14:04 jsumners

@jsumners pino-syslog convert to syslog format, I'm just curious how to override default pino severity levels with syslog one, but severity value is upside down.

cojack avatar Apr 14 '21 07:04 cojack

We established a log time ago that our algorithm is >= instead of <=. See https://github.com/pinojs/pino/issues/123

jsumners avatar Apr 14 '21 11:04 jsumners

@jsumners any future plan to provide a callback to override this behaviour?

cojack avatar Apr 14 '21 12:04 cojack

@cojack Did you manage to resolve this?

Fdawgs avatar May 29 '23 08:05 Fdawgs

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jun 29 '23 00:06 github-actions[bot]