Skip to content

Commit

Permalink
1.2.8 added exceptionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
objt-ev committed Jan 3, 2024
1 parent c30beb6 commit 42b0912
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions log-elk-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ module.exports = function (RED) {
filename: filename,
maxsize: filesize,
maxFiles: maxfiles,
handleExceptions: true,
format: winston.format.combine(winston.format.timestamp(), lineFormat)
})
);
Expand All @@ -75,7 +74,6 @@ module.exports = function (RED) {
var consoleLog = config.logconsole;
if (consoleLog) {
transports.push(new (winston.transports.Console)({
handleExceptions: true,
format: winston.format.combine(winston.format.timestamp(), lineFormat)
}));
}
Expand All @@ -84,9 +82,19 @@ module.exports = function (RED) {

if (elkLog || fileLog || consoleLog) {
this.logger = new winston.createLogger({
exitOnError: false,
level: 'debug',
transports: transports
transports: transports,
exceptionHandlers: [
new (winston.transports.Console)({
format: winston.format.combine(winston.format.timestamp(), lineFormat)
})
],
rejectionHandlers: [
new (winston.transports.Console)({
format: winston.format.combine(winston.format.timestamp(), lineFormat)
})
],
exitOnError: false
});

this.logger.on('error', (error) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-log-elk",
"version": "1.2.7",
"version": "1.2.8",
"description": "A Node-RED logging node with multiple outputs using the winston and winston-elasticsearch logging libraries",
"main": "log-elk.js",
"scripts": {
Expand Down

0 comments on commit 42b0912

Please sign in to comment.