1.6.0-beta5 • Published 5 years ago

@dkuida/logger-wrapper v1.6.0-beta5

Weekly downloads
42
License
MIT
Repository
github
Last release
5 years ago

Build Status

wrapper for winston configuration loader

Build Setup

# Install dependencies
npm install @dkuida/logger-wrapper

usage

short version

check the example folder

###longer version the config file will initialize the availbale transports by passing the configuration to each

  • console - official winston console

  • file - official winston file logger

  • fluentd - using fluent-logger

  • logstash - have a look at winston-logstash-transport

  • service - a common name that will be identify the project/service create a singleton loader in the form of

 import logger from '@dkuida/logger-wrapper';
 import * as loggerConfig from './config/logger';
 const loggerInstance = logger(loggerConfig);
 
 export default loggerInstance;

use the logger wherever you need

import loggerInstance from './logger';
const logger = loggerInstance(module);
logger.info('HELLO');

The label for the log message is extracted from the (module) - and is the file in which the call was invoked. In case you use moleculer.js you can add a property

labelExtractors: [LabelExtractor.moleculer]

which allow on service call to extract the labels for the nodes/brokers

Breaking changes

1.6.x
  • winston, winston-logstash-transport, fluentd-logger are all peer dependencies now.
1.5.x
  • the logger is not exported as default from the library
  • fatal level removed

License

The project is available under the MIT license.

1.6.0-beta5

5 years ago

1.6.0-beta3

5 years ago

1.6.0-beta1

5 years ago

1.6.0-beta0

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.4.24

5 years ago

1.4.23

5 years ago

1.4.22

5 years ago

1.4.16

5 years ago

1.4.15

5 years ago

1.4.14

5 years ago

1.4.13

6 years ago

1.4.12

6 years ago

1.4.11

6 years ago

1.4.10

6 years ago

1.4.9

6 years ago

1.4.8

6 years ago