simple-node-logger
simple-node-logger copied to clipboard
simple multi-level logger for console and file
In the app that I am writing, I want to send the log file somewhere (via email or sftp) if a particular error is captured. Is there a way to...
I want to keep last 7 days log? How is that possible?
const { spawn } = require('child_process'); const mysql = require('mysql'); logfile_opts = { logDirectory:'logs', // NOTE: folder must exist and be writable... fileNamePattern:'pheal-.log', dateFormat:'YYYYMMDDHHmm' } const log = require('simple-node-logger').createRollingFileLogger( logfile_opts...
it.only("should create mock logger", function() { const MockLogger = require('simple-node-logger').mocks.MockLogger; const log = MockLogger.createLogger('MyCategory'); log.info('this is a log statement'); log.getLogEntries().length.should.equal(0); }) TypeError: Cannot read property 'equal' of undefined
Hello, My current logger implementation is ``` let logger = undefined const getLogger = () => { if (logger === undefined) { logger = simpleLogger.createSimpleLogger({ timestampFormat: '-' }) logger.setLevel(LOG_LEVEL ||...
``` npm install @types/simple-node-logger npm ERR! code E404 npm ERR! 404 Not Found: @types/simple-node-logger@latest npm ERR! A complete log of this run can be found in: npm ERR! /Users/moff/.npm/_logs/2018-10-22T09_06_52_601Z-debug.log ```
so is will dismiss old entries and append new ones if limit is reached?
The section says: >You can create a single logger / log manager and add multiple appenders with different log levels. For example, you can add a console appender that has...
I'm writing a node CLI app, let's call it toto.js When I use the ``createSimpleLogger`` and execute my app `toto start` It runs it perfectly, create the log files +...