trentm / node-bunyan

a simple and fast JSON logging module for node.js services
Other
7.15k stars 513 forks source link

How can I get logLevels to show as String values like INFO instead of 30 in the log file ? #689

Open vijaybalakrishnanintel opened 2 years ago

vijaybalakrishnanintel commented 2 years ago

I use this: const logger = bunyan.createLogger({ name: 'logger', subSystem: 'scheduler', streams: [{ type: 'raw', stream: new RotatingFileStream({ path: './scheduler.log', period: '1d', // daily rotation totalFiles: 10, // keep 10 back copies rotateExisting: true, // Give ourselves a clean file when we start up, based on period threshold: '10m', // Rotate log files larger than 10 megabytes totalSize: '20m', // Don't keep more than 20mb of archived log files gzip: true // Compress the archive log files to save space }), level: (process.env.LOG_LEVEL) || 'debug' }] }); The log file shows log level as 30 for INFO etc. I would like to see the log level as INFO etc instead. TIA,

ferdibiflator commented 2 years ago

you can find it here https://github.com/trentm/node-bunyan/issues/194