Support disabling logger or default to noop logger
See original GitHub issueMy organization has its own logging format (mostly similar to Pino’s output). But I cannot boot our logger before this library due to issues. We also have log shippers and destinations that expect that specific format to be adhered to. So to prevent this module from writing incompatible logs I have to:
const apm = require('elastic-apm-node').start({
logger: Object.create(require('abstract-logging'))
});
At a very minimum, I’d like to see logger: false
as a supported option to disable the logger. A more complete solution would be to use abstract-logging
yourself internally and you’ll automatically gain compatibility with the list of loggers in https://github.com/elastic/apm-agent-nodejs/issues/1187#issuecomment-514103468. Note: this is what we do in Fastify – https://github.com/fastify/fastify/blob/0e39b83c3bde8a9cb6531ad2dbe960be75199e1d/lib/logger.js#L84-L88
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Yes, that does seem to be a way to get it solved for now. But it isn’t a foolproof solution. There is no guarantee that
logger.fatal
will not be used in the future. It would really be nice to have the ability to disable the logger completely bylogger: false
.In v3.10.0 of the agent support was added for an “off” logLevel in #1908