darrylwest/simple-node-logger

Remove auto createConsoleAppender from createLogManager

Closed this issue · 3 comments

https://github.com/darrylwest/simple-node-logger/blob/master/lib/SimpleLogger.js#L319-L322

I want to use the console and rollingFile.
The console should be formated with an own formatter, but this is not possible, when auto create the consoleAppender with createLogManager

I want to colorize the console output depending on the LogLevel.

I manually set now the appenders and create my own ColoredConsoleAppender.

  let appenders = [
    new ColoredConsoleAppender(),
    manager.createRollingFileAppender({
      errorEventName: 'error',
      logDirectory: logPath,
      fileNamePattern: '<DATE>.log',
      dateFormat:'YYYYMMDD'
    })
  ]

  let logger = manager.createLogger()
  logger.setAppenders(appenders)

Can you share your ColoredConsoleAppender?