Commit b5901f21 authored by CompileNix's avatar CompileNix

update slack intragration to get valuesfrom config

parent 439c786b
......@@ -18,8 +18,10 @@ class Config {
{ match: /HTTP\/\d\.\d\" 5\d{2}/g, subject: 'HTTP 5xx', matchCounter: 0 }
];
this.enableSlack = false;
this.slackWebHookUri = 'https://hooks.slack.com/services/xxxxxx/xxxxxx/xxxxxx'
this.debug = false // show additional console output
this.slackWebHookUri = 'https://hooks.slack.com/services/xxxxxx/xxxxxx/xxxxxx';
this.slackChannel = '#general';
this.slackUsername = 'webserver-access_log-bot';
this.debug = true;
}
};
......
......@@ -79,8 +79,8 @@ async function filterLog( /** @type {string} */ line) {
if (config.enableSlack) {
slack.webhook({
channel: "#general",
username: "web-access_log2slack",
channel: config.slackChannel,
username: config.slackUserName,
text: `${expression.subject}: ${line}`
}, (err, response) => {
console.log(response);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment