Skip to content

Commit 72f22e0

Browse files
author
Matt Berther
committed
disable symlink creation by default and allow the ability to customize the symlink name
1 parent 78cacc3 commit 72f22e0

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ The DailyRotateFile transport can rotate files by minute, hour, day, month, year
2929
* **auditFile**: A string representing the name of the name of the audit file. This can be used to override the default filename which is generated by computing a hash of the options object. (default: '.<optionsHash>.json')
3030
* **utc**: Use UTC time for date in filename. (default: false)
3131
* **extension**: File extension to be appended to the filename. (default: '')
32+
* **createSymlink**: Create a tailable symlink to the current active log file. (default: false)
33+
* **symlinkName**: The name of the tailable symlink. (default: 'current.log')
3234

3335
## Usage
3436
``` js

daily-rotate-file.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ var DailyRotateFile = function (options) {
8888
audit_file: options.auditFile ? options.auditFile : path.join(self.dirname, '.' + hash(options) + '-audit.json'),
8989
file_options: options.options ? options.options : {flags: 'a'},
9090
utc: options.utc ? options.utc : false,
91-
extension: options.extension ? options.extension : ''
91+
extension: options.extension ? options.extension : '',
92+
create_symlink: options.createSymlink ? options.createSymlink : false,
93+
symlink_name: options.symlinkName ? options.symlinkName : 'current.log'
9294
});
9395

9496
this.logStream.on('new', function (newFile) {

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"rimraf": "2.6.3"
4141
},
4242
"dependencies": {
43-
"file-stream-rotator": "^0.5.4",
43+
"file-stream-rotator": "^0.5.5",
4444
"object-hash": "^1.3.0",
4545
"triple-beam": "^1.3.0",
4646
"winston-transport": "^4.2.0"

0 commit comments

Comments
 (0)