Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanrahic committed Jul 21, 2020
1 parent e794ee0 commit c65c88b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit c65c88b

Please sign in to comment.