From fedbc853cb482b93b98da1e1efeb7d7618f5174d Mon Sep 17 00:00:00 2001 From: Dominik Sigmund <dominik.sigmund@br.de> Date: Tue, 7 Jul 2020 12:41:41 +0200 Subject: [PATCH] final graylog fix --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 2565dfc..829d529 100644 --- a/index.js +++ b/index.js @@ -41,8 +41,8 @@ function Log (options) { } catch (err) { try { this.fs.writeFileSync(this.path.join(this.options.path, this.options.file), '', { flag: 'wx' }) - } catch (err) { - throw new Error('Could not Create File ' + this.options.file + '\n' + err.toString()) + } catch (innerErr) { + throw new Error('Could not Create File ' + this.options.file + '\n' + innerErr.toString()) } } } @@ -121,11 +121,11 @@ function Log (options) { } if (this.options.graylog && this.options.graylog.active) { let data = JSON.stringify({ - short_message: msg, + short_message: message, timestamp: Date.now() / 1000, host: this.hostname, facility: this.name, - level: tag + level: this.levels[tag] }) this.udpclient.send(Buffer.from(data),this.options.graylog.port,this.options.graylog.server,function(error){ if(error){ -- GitLab