Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@sdv/node-logger

2.0.0 • Public • Published

Nodejs Logger

Console, File, RabbitMQ

Usage

// main.js
 
const loggerFactory = require('@sdv/node-logger');
 
loggerFactory.init({
   "app": "App.Name",
   "level": "debug",
   "console": {
     "stderrLevels": [],
     "timestamp": true
   },
   "file": {
     "filename": "App.Name-%DATE%.log",
     "datePattern": "YYYY-MM-DD-HH",
     "dirname": "./logs",
     "zippedArchive": true,
     "maxSize": "20m",
     "maxFiles": "14d"
   },
   "rabbitmq": {
     "silent": false,
     "level": "debug",
     "host": "logger",
     "vhost": "logging",
     "login": "log",
     "password": "log",
     "exchange": {
       "name": "logging-exchange",
       "properties": {
         "type": "topic",
         "durable": true,
         "autoDelete": false
       }
     }
   },
   "transports": [ "console", "file", "rabbitmq" ]
 })
// module.js
 
const { logger } = require('@sdv/node-logger');
 
logger.info('Hello world!');

Keywords

none

Install

npm i @sdv/node-logger

DownloadsWeekly Downloads

38

Version

2.0.0

License

none

Unpacked Size

4.08 kB

Total Files

5

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar