Skip to content
Snippets Groups Projects
Commit ed7a8f33 authored by admin-sigmundd's avatar admin-sigmundd
Browse files

Graylog Support into a new Branch

parent 460f344e
No related branches found
No related tags found
1 merge request!1Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
......@@ -29,12 +29,6 @@ Note: The options Part may be omitted, as all parts are optional, but using the
{
name: 'Name of App. Default: Name of BaseFolder',
hostname: 'Server Hostname, Default: os.hostname()',
file: 'File to Append Log to',
graylog: [
{
server: 'graylog-server',
port: 'graylog-port'
}
]
file: 'File to Append Log to'
}
```
\ No newline at end of file
......@@ -14,14 +14,6 @@ function Log (options) {
if (this.options.file) {
this.fs = require('fs')
}
if (this.options.graylog) {
this.graylog2 = require('graylog2')
this.graylogger = new this.graylog2.graylog({ // eslint-disable-line new-cap
servers: this.options.graylog,
hostname: this.hostname,
facility: this.name
})
}
this.info = function (message) {
this.log('INFO', message)
}
......@@ -71,30 +63,6 @@ function Log (options) {
}
})
}
if (this.options.graylog) {
switch (tag) {
case 'INFO':
this.graylogger.info(message)
break
case 'NOTICE':
this.graylogger.notice(message)
break
case 'WARN':
this.graylogger.warning(message)
break
case 'ERROR':
this.graylogger.error(message)
break
case 'FATAL':
this.graylogger.critical(message)
break
case 'DEBUG':
this.graylogger.debug(message)
break
default:
this.graylogger.notice(message)
}
}
}
this.getDate = function () {
var tzoffset = (new Date()).getTimezoneOffset() * 60000 // offset in milliseconds
......
......@@ -9,6 +9,5 @@
"author": "Dominik Sigmund",
"license": "ISC",
"dependencies": {
"graylog2": "^0.2.1"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment