Skip to content

Commit

Permalink
create audit file name based on hash of options (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattberther committed Sep 25, 2018
1 parent e0b4f77 commit 0119ca4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daily-rotate-file.js
Expand Up @@ -6,6 +6,7 @@ var path = require('path');
var util = require('util');
var semver = require('semver');
var zlib = require('zlib');
var hash = require('object-hash');
var winston = require('winston');
var compat = require('winston-compat');
var MESSAGE = require('triple-beam').MESSAGE;
Expand Down Expand Up @@ -85,7 +86,8 @@ var DailyRotateFile = function (options) {
verbose: false,
size: getMaxSize(options.maxSize),
max_logs: options.maxFiles,
end_stream: true
end_stream: true,
audit_file: path.join(self.dirname, '.' + hash(options) + '-audit.json')
});

this.logStream.on('rotate', function (oldFile, newFile) {
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -41,6 +41,7 @@
},
"dependencies": {
"file-stream-rotator": "^0.3.1",
"object-hash": "^1.3.0",
"semver": "^5.5.0",
"triple-beam": "^1.3.0",
"winston-compat": "^0.1.4",
Expand Down

0 comments on commit 0119ca4

Please sign in to comment.