@@ -69,7 +69,7 @@ var DailyRotateFile = module.exports = function (options) {
69
69
this . prettyPrint = options . prettyPrint || false ;
70
70
this . showLevel = options . showLevel === undefined ? true : options . showLevel ;
71
71
this . timestamp = options . timestamp ? options . timestamp : true ;
72
- this . datePattern = options . datePattern ? options . datePattern : 'yyyy-MM-dd' ;
72
+ this . datePattern = options . datePattern ? options . datePattern : '. yyyy-MM-dd' ;
73
73
this . depth = options . depth || null ;
74
74
this . eol = options . eol || os . EOL ;
75
75
this . maxRetries = options . maxRetries || 2 ;
@@ -598,17 +598,18 @@ DailyRotateFile.prototype._getFile = function (inc) {
598
598
// Returns the log filename depending on `this.prepend` option value
599
599
//
600
600
DailyRotateFile . prototype . _getFilename = function ( ) {
601
- if ( this . datePattern . substring ( 0 , 1 ) === '.' ) {
602
- this . datePattern = this . datePattern . substring ( 1 ) ;
603
- }
604
-
605
601
var formattedDate = this . getFormattedDate ( ) ;
606
602
607
603
if ( this . prepend ) {
608
- return [ formattedDate , this . _basename ] . join ( '.' ) ;
604
+ if ( this . datePattern === '.yyyy-MM-dd' ) {
605
+ this . datePattern = 'yyyy-MM-dd.' ;
606
+ formattedDate = this . getFormattedDate ( ) ;
607
+ }
608
+
609
+ return formattedDate + this . _basename ;
609
610
}
610
611
611
- return [ this . _basename , formattedDate ] . join ( '.' ) ;
612
+ return this . _basename + formattedDate ;
612
613
} ;
613
614
614
615
//
0 commit comments