log4js-memory-appender
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -5,9 +5,8 @@ "use strict"; | ||
var layouts = require('log4js').layouts; | ||
var defaultOptions = { buffer : [], maxBufferSize : 100 }; | ||
var buffer = null; | ||
var maxBufferSize = null; | ||
options = options || defaultOptions; | ||
buffer = options.buffer || defaultOptions.buffer; | ||
maxBufferSize = options.maxBufferSize || defaultOptions.maxBufferSize; | ||
options = options || {}; | ||
buffer = options.buffer || []; | ||
maxBufferSize = options.maxBufferSize || 100; | ||
@@ -14,0 +13,0 @@ var memoryAppender = function(layout, timezoneOffset) { |
{ | ||
"name": "log4js-memory-appender", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "log4js memory appender - stores log events in an array. Good for storing a buffer of tail log events to output on a diagnostics page.", | ||
@@ -5,0 +5,0 @@ "main": "log4js-memory-appender.js", |
# log4js-memory-appender | ||
log4js memory appender - stores log events in an array. Good for storing a buffer of tail log events to output on a diagnostics page. | ||
A simple memory appender for log4js. It stores log events in an array - good for keeping a buffer of tail logs to output on a diagnostics page. | ||
@@ -5,0 +5,0 @@ ## install |
var log4js = require('log4js'); | ||
var appender = require('./log4js-memory-appender'); | ||
//var buffer = []; | ||
//var maxBufferSize = 100; | ||
var memAppender = appender({ maxBufferSize : 1000 }); | ||
//log4js.loadAppender('memory', appender({ buffer : buffer, maxBufferSize : maxBufferSize })); | ||
log4js.loadAppender('memory', memAppender); | ||
@@ -24,5 +21,2 @@ log4js.addAppender(log4js.appenders.memory()); | ||
//console.log(memAppender); | ||
console.log(memAppender.getBuffer()); | ||
//console.log(buffer); | ||
console.log(memAppender.getBuffer()); |
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
6869
7
69