-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
egg-logger will generate json file when outputJson is true, and it should be rotated.
- Loading branch information
1 parent
750c6bf
commit 3acae72
Showing
4 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
test/fixtures/logrotator-json-format/config/config.default.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
|
||
module.exports = () => { | ||
const exports = { | ||
logger: { | ||
outputJSON: true, | ||
}, | ||
logrotator: { | ||
filesRotateByHour: [ | ||
path.join(__dirname, '../logs', 'logrotator', 'hour.log'), | ||
path.join(__dirname, '../logs', 'logrotator', 'hour.json.log'), | ||
], | ||
filesRotateBySize: [ | ||
path.join(__dirname, '../logs', 'logrotator', 'size.log'), | ||
path.join(__dirname, '../logs', 'logrotator', 'size.json.log'), | ||
], | ||
maxFileSize: 1, | ||
maxFiles: 2, | ||
}, | ||
customLogger: { | ||
dayLogger: { | ||
file: path.join(__dirname, '../logs', 'logrotator', 'day.log'), | ||
}, | ||
sizeLogger: { | ||
file: path.join(__dirname, '../logs', 'logrotator', 'size.log'), | ||
}, | ||
hourLogger: { | ||
file: path.join(__dirname, '../logs', 'logrotator', 'hour.log'), | ||
}, | ||
}, | ||
}; | ||
return exports; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "logrotator", | ||
"dependencies": { | ||
}, | ||
"private":true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters