Comparing version 3.0.7 to 4.0.0
@@ -8,3 +8,3 @@ var log8js, os; | ||
log8js.open = function(app, module, debug, config) { | ||
log8js.open = function(app, module, debug, config, parallelsAppender) { | ||
var log4js, log4jsConfig; | ||
@@ -23,3 +23,4 @@ log4jsConfig = { | ||
log4jsConfig.appenders[1] = { | ||
type: "console" | ||
type: "console", | ||
tag: app | ||
}; | ||
@@ -40,3 +41,12 @@ } | ||
if (typeof(parallelsAppender) == 'object'){ | ||
parallelsAppender.type = 'log4js-syslog-appender'; | ||
parallelsAppender.tag = app; | ||
if(typeof(log4jsConfig.appenders[1]) == 'object') { | ||
log4jsConfig.appenders[2] = parallelsAppender; | ||
}else | ||
log4jsConfig.appenders[1] = parallelsAppender; | ||
} | ||
log4js = require('log4js'); | ||
@@ -43,0 +53,0 @@ log4jsConfig.appenders[0].tag = app; |
{ | ||
"name": "log8js", | ||
"version": "3.0.7", | ||
"version": "4.0.0", | ||
"description": "a syslog/rsyslog logger helper for node apps, work with pm2 log verbose", | ||
@@ -5,0 +5,0 @@ "main": "log8js.js", |
@@ -42,3 +42,3 @@ # log8js helper | ||
## Overwrite Config | ||
### Overwrite Config Samples | ||
@@ -63,2 +63,28 @@ ``` | ||
### Parallels Log Config Samples | ||
``` | ||
var log8js, logger, logConfig, parallelsLogConfig; | ||
log8js = require('./log8js'); | ||
//overwrite config | ||
logConfig = { | ||
"facility": "local0", | ||
"hostname": "chotot-demolog-service", | ||
"port": 514 | ||
} | ||
parallelsLogConfig = { | ||
"facility": "local1", | ||
"hostname": "graylog-chotot-demolog-service", | ||
"port": 514 | ||
} | ||
logger = log8js.open('appname', 'modulename', 'verbose', logConfig, parallelsLogConfig); | ||
logger.debug('this is debug of app: appname module:modulename'); | ||
``` | ||
### Open Another log with verbose debug | ||
@@ -65,0 +91,0 @@ |
11
test.js
@@ -1,2 +0,2 @@ | ||
var log8js, logger, logConfig; | ||
var log8js, logger, logConfig, parallelsLogConfig; | ||
@@ -7,9 +7,14 @@ log8js = require('./log8js'); | ||
logConfig = { | ||
"facility": "local1", | ||
"facility": "local0", | ||
"hostname": "chotot-demolog-service", | ||
"port": 514 | ||
} | ||
parallelsLogConfig = { | ||
"facility": "local1", | ||
"hostname": "graylog-chotot-demolog-service", | ||
"port": 514 | ||
} | ||
logger = log8js.open('appname', 'modulename', 'verbose', logConfig); | ||
logger = log8js.open('appname', 'modulename', 'verbose', logConfig, parallelsLogConfig); | ||
logger.debug('this is debug of app: appname module:modulename'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6829
64
125