mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
chore(refactor): fileSyncAppender to have same internal code ordering as fileAppender
This commit is contained in:
parent
3dfa03e36b
commit
8d2a211a9f
@ -175,15 +175,22 @@ class RollingFileSync {
|
||||
* if not provided then logs won't be rotated.
|
||||
* @param numBackups - the number of log files to keep after logSize
|
||||
* has been reached (default 5)
|
||||
* @param timezoneOffset - optional timezone offset in minutes
|
||||
* (default system local)
|
||||
* @param options - passed as is to fs options
|
||||
* @param options - options to be passed to the underlying stream
|
||||
* @param timezoneOffset - optional timezone offset in minutes (default system local)
|
||||
*/
|
||||
function fileAppender(file, layout, logSize, numBackups, timezoneOffset, options) {
|
||||
debug('fileSync appender created');
|
||||
function fileAppender(file, layout, logSize, numBackups, options, timezoneOffset) {
|
||||
file = path.normalize(file);
|
||||
numBackups = (!numBackups && numBackups !== 0) ? 5 : numBackups;
|
||||
|
||||
debug(
|
||||
'Creating fileSync appender (',
|
||||
file, ', ',
|
||||
logSize, ', ',
|
||||
numBackups, ', ',
|
||||
options, ', ',
|
||||
timezoneOffset, ')'
|
||||
);
|
||||
|
||||
function openTheStream(filePath, fileSize, numFiles) {
|
||||
let stream;
|
||||
|
||||
@ -234,8 +241,8 @@ function configure(config, layouts) {
|
||||
layout,
|
||||
config.maxLogSize,
|
||||
config.backups,
|
||||
config.timezoneOffset,
|
||||
options
|
||||
options,
|
||||
config.timezoneOffset
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user