From c65c88b138ef8fda03be9abd5564d00e928ef556 Mon Sep 17 00:00:00 2001 From: Adnan Rahic Date: Tue, 21 Jul 2020 12:36:40 +0200 Subject: [PATCH] updated readme --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0b8a298..e1a5da8 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ Create your free account and access token [here](https://apps.sematext.com/ui/re ```js -var winston = require('winston') +const { createLogger, config } = require('winston') var Logsene = require('winston-logsene') -var logger = winston.createLogger({ - levels: winston.config.npm.levels, +var logger = createLogger({ + levels: config.npm.levels, transports: [new Logsene({ token: process.env.LOGS_TOKEN, level: 'debug', @@ -40,15 +40,14 @@ var logger = winston.createLogger({ ### Examples ```js -// var winston = require('winston') var Logsene = require('winston-logsene') -const {createLogger, format} = require('winston') +const { createLogger, format, config } = require('winston') // example for custom rewriter, e.g. add myServerIp field to all logs var myServerIp = '10.0.0.12' var logger = createLogger({ - levels: winston.config.npm.levels, + levels: config.npm.levels, transports: [new Logsene({ // set log level, defaut is 'info' level: 'debug',