Skip to content

Commit 80066d4

Browse files
committed
check both file and filename
README says to use filename property, but it only checks file property. To maintain backwards compatibility it should check both.
1 parent 83cbc8d commit 80066d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function(opts){
2020
},
2121
{
2222
type: 'file',
23-
filename: opts.file,
23+
filename: opts.file || opts.filename,
2424
maxLogSize: opts.size || 10*1024*1024,
2525
backups: opts.backups || 4,
2626
category: loggerName
@@ -45,4 +45,4 @@ module.exports = function(opts){
4545
// add more info
4646
// 解析配置选项, 创建file logger, 支持log 内容配置
4747
// 从其他middleware中可以获取到 logger
48-
// 日志格式可参看 log4js的 connetct-logger
48+
// 日志格式可参看 log4js的 connetct-logger

0 commit comments

Comments
 (0)