Skip to content

Commit

Permalink
fix: remove winston-elasticsearch support. Caused crash and is no lon…
Browse files Browse the repository at this point in the history
…ger used.
  • Loading branch information
olzzon committed Jun 22, 2021
1 parent 233d36f commit 955d52a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 643 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
"utf-8-validate": "^5.0.4",
"web-midi-api": "^2.0.8",
"webmidi": "^2.5.2",
"winston": "^3.3.3",
"winston-elasticsearch": "^0.15.2"
"winston": "^3.3.3"
},
"devDependencies": {
"@babel/core": "^7.13.10",
Expand Down
8 changes: 0 additions & 8 deletions server/utils/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import winston from 'winston'
import Elasticsearch from 'winston-elasticsearch'
const processArgs = require('minimist')(process.argv.slice(2))

const loggerIp = process.env.loggerIp || processArgs.loggerIp || '0.0.0.0'
Expand All @@ -13,12 +12,6 @@ const loggerConsoleLevel =
console.log('Elastic Ip :', loggerIp)
console.log('Elastic Port :', loggerPort)

const esTransportOpts = {
level: loggerLevel,
indexPrefix: 'sisyfos',
clientOpts: { node: 'http://' + loggerIp + ':' + String(loggerPort) },
}

const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
Expand All @@ -28,7 +21,6 @@ const logger = winston.createLogger({
level: loggerFileLevel,
}), //save errors on file
new winston.transports.Console({ level: loggerConsoleLevel }), //save errors on file
new Elasticsearch.ElasticsearchTransport(esTransportOpts), //everything info and above goes to elastic
],
})

Expand Down
Loading

0 comments on commit 955d52a

Please sign in to comment.