Skip to content

Commit

Permalink
Fixed file logging default sizing & maxfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
objt-product committed Jun 17, 2021
1 parent 8e35b92 commit 0b79e5a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions log-elk-logger.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
password: { value: "" },
filename: { value: "log-elk.log", required: true },
maxsize: { value: 1, required: true, validate: function(v) { return v >= 1 } },
maxfiles: { value: 10, required: true, validate: function(v) { return v >= 1 } },
maxfiles: { value: 1, required: true, validate: function(v) { return v >= 1 } },
logelk: { value: false },
logfile: { value: false },
logconsole: { value: false },
Expand Down Expand Up @@ -99,7 +99,7 @@
</div>
<div class="form-row" style="padding-left:20px;">
<label for="node-config-input-maxFiles"><i class="fa fa-files-o"></i> Max Files</label>
<input type="number" id="node-config-input-maxFiles" style="width:80px; height:25px;" placeholder="10">
<input type="number" id="node-config-input-maxFiles" style="width:80px; height:25px;" placeholder="1">
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions log-elk-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ module.exports = function (RED) {
var filename = config.filename;
if (filename) {
var maxFiles = 1;
var filesize = 1073741824;
if (config.maxsize >= 1) filesize = config.maxsize * 1073741824;
var filesize = 1048576;
if (config.maxsize >= 1) filesize = config.maxsize * 1048576;
if (config.maxFiles >= 1) maxfiles = config.maxFiles;

transports.push(new (winston.transports.File)({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-log-elk",
"version": "1.2.1",
"version": "1.2.2",
"description": "A Node-RED logging node with multiple outputs using the winston and winston-elasticsearch logging libraries",
"main": "log-elk.js",
"scripts": {
Expand Down

0 comments on commit 0b79e5a

Please sign in to comment.