Comparing version 6.1.2 to 6.2.0
# log4js-node changelog | ||
## 6.2.0 | ||
- [Add custom message end token to TCP appender](https://github.com/log4js-node/log4js-node/pull/994) - thanks [@rnd-debug](https://github.com/rnd-debug) | ||
- [Update acorn (dev dep of a dep)](https://github.com/log4js-node/log4js-node/pull/992) - thanks Github Robots. | ||
## 6.1.2 | ||
@@ -4,0 +9,0 @@ |
@@ -6,3 +6,3 @@ | ||
function appender(config) { | ||
function appender(config, layout) { | ||
let canWrite = false; | ||
@@ -12,6 +12,7 @@ const buffer = []; | ||
let shutdownAttempts = 3; | ||
let endMsg = '__LOG4JS__'; | ||
function write(loggingEvent) { | ||
debug('Writing log event to socket'); | ||
canWrite = socket.write(`${loggingEvent.serialise()}__LOG4JS__`, 'utf8'); | ||
canWrite = socket.write(`${layout(loggingEvent)}${endMsg}`, 'utf8'); | ||
} | ||
@@ -30,2 +31,3 @@ | ||
debug(`appender creating socket to ${config.host || 'localhost'}:${config.port || 5000}`); | ||
endMsg = `${config.endMsg || '__LOG4JS__'}`; | ||
socket = net.createConnection(config.port || 5000, config.host || 'localhost'); | ||
@@ -74,7 +76,13 @@ socket.on('connect', () => { | ||
function configure(config) { | ||
function configure(config, layouts) { | ||
debug(`configure with config = ${config}`); | ||
return appender(config); | ||
let layout = function (loggingEvent) { | ||
return loggingEvent.serialise(); | ||
}; | ||
if (config.layout) { | ||
layout = layouts.layout(config.layout.type, config.layout); | ||
} | ||
return appender(config, layout); | ||
} | ||
module.exports.configure = configure; |
{ | ||
"name": "log4js", | ||
"version": "6.1.2", | ||
"version": "6.2.0", | ||
"description": "Port of Log4js to work with node.", | ||
@@ -63,3 +63,3 @@ "homepage": "https://log4js-node.github.io/log4js-node/", | ||
"proxyquire": "^2.1.3", | ||
"tap": "^14.9.2", | ||
"tap": "^14.10.7", | ||
"typescript": "^3.7.2", | ||
@@ -66,0 +66,0 @@ "validate-commit-msg": "^2.14.0" |
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
103656
2712