@eggjs/logrotator 5.0.0-beta.35 → 5.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +6 -2
- package/dist/app/extend/agent.d.ts +6 -3
- package/dist/app/extend/agent.js +7 -6
- package/dist/app/extend/application.d.ts +6 -3
- package/dist/app/extend/application.js +7 -5
- package/dist/app/schedule/clean_log.d.ts +6 -3
- package/dist/app/schedule/clean_log.js +56 -66
- package/dist/app/schedule/rotate_by_file.d.ts +6 -3
- package/dist/app/schedule/rotate_by_file.js +17 -13
- package/dist/app/schedule/rotate_by_hour.d.ts +6 -3
- package/dist/app/schedule/rotate_by_hour.js +17 -13
- package/dist/app/schedule/rotate_by_size.d.ts +6 -3
- package/dist/app/schedule/rotate_by_size.js +17 -13
- package/dist/app.d.ts +2 -2
- package/dist/app.js +6 -2
- package/dist/boot.d.ts +9 -5
- package/dist/boot.js +16 -14
- package/dist/config/config.default.d.ts +59 -57
- package/dist/config/config.default.js +15 -14
- package/dist/index.d.ts +21 -17
- package/dist/index.js +25 -22
- package/dist/lib/day_rotator.d.ts +11 -7
- package/dist/lib/day_rotator.js +62 -78
- package/dist/lib/hour_rotator.d.ts +9 -5
- package/dist/lib/hour_rotator.js +37 -38
- package/dist/lib/rotator.d.ts +17 -13
- package/dist/lib/rotator.js +54 -71
- package/dist/lib/size_rotator.d.ts +8 -4
- package/dist/lib/size_rotator.js +60 -66
- package/dist/lib/utils.d.ts +9 -7
- package/dist/lib/utils.js +13 -14
- package/dist/types.d.ts +19 -17
- package/dist/types.js +1 -2
- package/package.json +25 -31
package/dist/agent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Boot } from
|
|
2
|
-
export default
|
|
1
|
+
import { Boot } from "./boot.js";
|
|
2
|
+
export { Boot as default };
|
package/dist/agent.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { Boot } from "./boot.js";
|
|
2
|
-
|
|
3
|
-
//#
|
|
2
|
+
|
|
3
|
+
//#region src/agent.ts
|
|
4
|
+
var agent_default = Boot;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { agent_default as default };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { LogRotator } from
|
|
1
|
+
import { LogRotator } from "../../lib/rotator.js";
|
|
2
|
+
|
|
3
|
+
//#region src/app/extend/agent.d.ts
|
|
2
4
|
declare const extensions: {
|
|
3
|
-
|
|
5
|
+
LogRotator: typeof LogRotator;
|
|
4
6
|
};
|
|
5
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { extensions as default };
|
package/dist/app/extend/agent.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LogRotator } from "../../lib/rotator.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//#
|
|
2
|
+
|
|
3
|
+
//#region src/app/extend/agent.ts
|
|
4
|
+
const extensions = { LogRotator };
|
|
5
|
+
var agent_default = extensions;
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { agent_default as default };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { LogRotator } from
|
|
1
|
+
import { LogRotator } from "../../lib/rotator.js";
|
|
2
|
+
|
|
3
|
+
//#region src/app/extend/application.d.ts
|
|
2
4
|
declare const extensions: {
|
|
3
|
-
|
|
5
|
+
LogRotator: typeof LogRotator;
|
|
4
6
|
};
|
|
5
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { extensions as default };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { LogRotator } from "../../lib/rotator.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
|
|
3
|
+
//#region src/app/extend/application.ts
|
|
4
|
+
const extensions = { LogRotator };
|
|
5
|
+
var application_default = extensions;
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { application_default as default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Application } from "egg";
|
|
2
|
+
import { EggScheduleHandler } from "egg/schedule";
|
|
3
|
+
|
|
4
|
+
//#region src/app/schedule/clean_log.d.ts
|
|
3
5
|
declare const _default: (app: Application) => EggScheduleHandler;
|
|
4
|
-
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
|
@@ -1,70 +1,60 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import moment from 'moment';
|
|
4
|
-
import { exists } from 'utility';
|
|
5
1
|
import { walkLoggerFile } from "../../lib/utils.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import { exists } from "utility";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import moment from "moment";
|
|
6
|
+
|
|
7
|
+
//#region src/app/schedule/clean_log.ts
|
|
8
|
+
var clean_log_default = (app) => ({
|
|
9
|
+
schedule: {
|
|
10
|
+
type: "worker",
|
|
11
|
+
cron: "0 0 * * *"
|
|
12
|
+
},
|
|
13
|
+
async task() {
|
|
14
|
+
const logger = app.coreLogger;
|
|
15
|
+
const logDirs = /* @__PURE__ */ new Set();
|
|
16
|
+
const loggerFiles = walkLoggerFile(app.loggers);
|
|
17
|
+
for (const file of loggerFiles) {
|
|
18
|
+
const logDir = path.dirname(file);
|
|
19
|
+
logDirs.add(logDir);
|
|
20
|
+
}
|
|
21
|
+
const maxDays = app.config.logrotator.maxDays;
|
|
22
|
+
if (maxDays && maxDays > 0) try {
|
|
23
|
+
const tasks = Array.from(logDirs, (logDir) => removeExpiredLogFiles(logDir, maxDays, logger));
|
|
24
|
+
await Promise.all(tasks);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
logger.error(err);
|
|
27
|
+
}
|
|
28
|
+
logger.info("[@eggjs/logrotator] clean all log before %s days", maxDays);
|
|
29
|
+
}
|
|
32
30
|
});
|
|
33
|
-
// remove expired log files: xxx.log.YYYY-MM-DD
|
|
34
31
|
async function removeExpiredLogFiles(logDir, maxDays, logger) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
await fs.unlink(logFile);
|
|
62
|
-
}
|
|
63
|
-
catch (e) {
|
|
64
|
-
const err = e;
|
|
65
|
-
err.message = `[@eggjs/logrotator] remove logFile ${logFile} error, ${err.message}`;
|
|
66
|
-
logger.error(err);
|
|
67
|
-
}
|
|
68
|
-
}));
|
|
32
|
+
if (!await exists(logDir)) {
|
|
33
|
+
logger.warn(`[@eggjs/logrotator] logDir ${logDir} not exists`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const files = await fs.readdir(logDir);
|
|
37
|
+
const expiredDate = moment().subtract(maxDays, "days").startOf("date");
|
|
38
|
+
const names = files.filter((file) => {
|
|
39
|
+
const name = path.extname(file).slice(1);
|
|
40
|
+
if (!/^\d{4}-\d{2}-\d{2}/.test(name)) return false;
|
|
41
|
+
const date = moment(name, "YYYY-MM-DD").startOf("date");
|
|
42
|
+
if (!date.isValid()) return false;
|
|
43
|
+
return date.isBefore(expiredDate);
|
|
44
|
+
});
|
|
45
|
+
if (names.length === 0) return;
|
|
46
|
+
logger.info(`[@eggjs/logrotator] start remove ${logDir} files: ${names.join(", ")}`);
|
|
47
|
+
await Promise.all(names.map(async (name) => {
|
|
48
|
+
const logFile = path.join(logDir, name);
|
|
49
|
+
try {
|
|
50
|
+
await fs.unlink(logFile);
|
|
51
|
+
} catch (e) {
|
|
52
|
+
const err = e;
|
|
53
|
+
err.message = `[@eggjs/logrotator] remove logFile ${logFile} error, ${err.message}`;
|
|
54
|
+
logger.error(err);
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
69
57
|
}
|
|
70
|
-
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { clean_log_default as default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Application } from "egg";
|
|
2
|
+
import { EggScheduleHandler } from "egg/schedule";
|
|
3
|
+
|
|
4
|
+
//#region src/app/schedule/rotate_by_file.d.ts
|
|
3
5
|
declare const _default: (app: Application) => EggScheduleHandler;
|
|
4
|
-
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { DayRotator } from "../../lib/day_rotator.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
|
|
3
|
+
//#region src/app/schedule/rotate_by_file.ts
|
|
4
|
+
var rotate_by_file_default = (app) => {
|
|
5
|
+
const rotator = new DayRotator({ app });
|
|
6
|
+
return {
|
|
7
|
+
schedule: {
|
|
8
|
+
type: "worker",
|
|
9
|
+
cron: "1 0 0 * * *",
|
|
10
|
+
disable: app.config.logrotator.disableRotateByDay
|
|
11
|
+
},
|
|
12
|
+
async task() {
|
|
13
|
+
await rotator.rotate();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
14
16
|
};
|
|
15
|
-
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { rotate_by_file_default as default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Application } from "egg";
|
|
2
|
+
import { EggScheduleHandler } from "egg/schedule";
|
|
3
|
+
|
|
4
|
+
//#region src/app/schedule/rotate_by_hour.d.ts
|
|
3
5
|
declare const _default: (app: Application) => EggScheduleHandler;
|
|
4
|
-
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { HourRotator } from "../../lib/hour_rotator.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
|
|
3
|
+
//#region src/app/schedule/rotate_by_hour.ts
|
|
4
|
+
var rotate_by_hour_default = (app) => {
|
|
5
|
+
const rotator = new HourRotator({ app });
|
|
6
|
+
return {
|
|
7
|
+
schedule: {
|
|
8
|
+
type: "worker",
|
|
9
|
+
cron: "1 * * * *",
|
|
10
|
+
disable: (app.config.logrotator.filesRotateByHour || []).length === 0
|
|
11
|
+
},
|
|
12
|
+
async task() {
|
|
13
|
+
await rotator.rotate();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
14
16
|
};
|
|
15
|
-
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { rotate_by_hour_default as default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Application } from "egg";
|
|
2
|
+
import { EggScheduleHandler } from "egg/schedule";
|
|
3
|
+
|
|
4
|
+
//#region src/app/schedule/rotate_by_size.d.ts
|
|
3
5
|
declare const _default: (app: Application) => EggScheduleHandler;
|
|
4
|
-
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { SizeRotator } from "../../lib/size_rotator.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
|
|
3
|
+
//#region src/app/schedule/rotate_by_size.ts
|
|
4
|
+
var rotate_by_size_default = (app) => {
|
|
5
|
+
const rotator = new SizeRotator({ app });
|
|
6
|
+
return {
|
|
7
|
+
schedule: {
|
|
8
|
+
type: "worker",
|
|
9
|
+
interval: app.config.logrotator.rotateDuration,
|
|
10
|
+
disable: (app.config.logrotator.filesRotateBySize || []).length === 0
|
|
11
|
+
},
|
|
12
|
+
async task() {
|
|
13
|
+
await rotator.rotate();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
14
16
|
};
|
|
15
|
-
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { rotate_by_size_default as default };
|
package/dist/app.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Boot } from
|
|
2
|
-
export default
|
|
1
|
+
import { Boot } from "./boot.js";
|
|
2
|
+
export { Boot as default };
|
package/dist/app.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { Boot } from "./boot.js";
|
|
2
|
-
|
|
3
|
-
//#
|
|
2
|
+
|
|
3
|
+
//#region src/app.ts
|
|
4
|
+
var app_default = Boot;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { app_default as default };
|
package/dist/boot.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Application, ILifecycleBoot } from "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/boot.d.ts
|
|
4
|
+
declare class Boot implements ILifecycleBoot {
|
|
5
|
+
private readonly app;
|
|
6
|
+
constructor(app: Application);
|
|
7
|
+
didLoad(): Promise<void>;
|
|
6
8
|
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Boot };
|
package/dist/boot.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
1
|
+
//#region src/boot.ts
|
|
2
|
+
var Boot = class {
|
|
3
|
+
app;
|
|
4
|
+
constructor(app) {
|
|
5
|
+
this.app = app;
|
|
6
|
+
}
|
|
7
|
+
async didLoad() {
|
|
8
|
+
this.app.messenger.on("log-reload", () => {
|
|
9
|
+
this.app.loggers.reload();
|
|
10
|
+
this.app.coreLogger.info("[@eggjs/logrotator] %s logger reload: got log-reload message", this.app.type);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Boot };
|
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
//#region src/config/config.default.d.ts
|
|
2
|
+
interface LogrotatorConfig {
|
|
3
|
+
/**
|
|
4
|
+
* Disable rotate by day
|
|
5
|
+
*
|
|
6
|
+
* Default: `false`
|
|
7
|
+
*/
|
|
8
|
+
disableRotateByDay: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* List of files that will be rotated by hour
|
|
11
|
+
*
|
|
12
|
+
* Default: `null`
|
|
13
|
+
*/
|
|
14
|
+
filesRotateByHour: string[] | null;
|
|
15
|
+
/**
|
|
16
|
+
* Hour delimiter
|
|
17
|
+
*
|
|
18
|
+
* Default: `-`
|
|
19
|
+
*/
|
|
20
|
+
hourDelimiter: string;
|
|
21
|
+
/**
|
|
22
|
+
* List of files that will be rotated by size
|
|
23
|
+
*
|
|
24
|
+
* Default: `null`
|
|
25
|
+
*/
|
|
26
|
+
filesRotateBySize: string[] | null;
|
|
27
|
+
/**
|
|
28
|
+
* Max file size to judge if any file need rotate
|
|
29
|
+
*
|
|
30
|
+
* Default: `50 * 1024 * 1024`
|
|
31
|
+
*/
|
|
32
|
+
maxFileSize: number;
|
|
33
|
+
/**
|
|
34
|
+
* Max files to keep
|
|
35
|
+
*
|
|
36
|
+
* Default: `10`
|
|
37
|
+
*/
|
|
38
|
+
maxFiles: number;
|
|
39
|
+
/**
|
|
40
|
+
* Time interval to judge if any file need rotate
|
|
41
|
+
*
|
|
42
|
+
* Default: `60000`
|
|
43
|
+
*/
|
|
44
|
+
rotateDuration: number;
|
|
45
|
+
/**
|
|
46
|
+
* Max days to keep log files, set `0` to keep all logs.
|
|
47
|
+
*
|
|
48
|
+
* Default: `31`
|
|
49
|
+
*/
|
|
50
|
+
maxDays: number;
|
|
51
|
+
/**
|
|
52
|
+
* Enable gzip compression for rotated files
|
|
53
|
+
*
|
|
54
|
+
* Default: `false`
|
|
55
|
+
*/
|
|
56
|
+
gzip: boolean;
|
|
56
57
|
}
|
|
57
58
|
declare const _default: {
|
|
58
|
-
|
|
59
|
+
logrotator: LogrotatorConfig;
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
//#endregion
|
|
62
|
+
export { LogrotatorConfig, _default as default };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//#
|
|
1
|
+
//#region src/config/config.default.ts
|
|
2
|
+
var config_default_default = { logrotator: {
|
|
3
|
+
disableRotateByDay: false,
|
|
4
|
+
filesRotateByHour: null,
|
|
5
|
+
hourDelimiter: "-",
|
|
6
|
+
filesRotateBySize: null,
|
|
7
|
+
maxFileSize: 50 * 1024 * 1024,
|
|
8
|
+
maxFiles: 10,
|
|
9
|
+
rotateDuration: 6e4,
|
|
10
|
+
maxDays: 31,
|
|
11
|
+
gzip: false
|
|
12
|
+
} };
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { config_default_default as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { LogRotator, RotateFile, RotatorOptions } from "./lib/rotator.js";
|
|
2
|
+
import "./types.js";
|
|
3
|
+
import { EggPluginFactory } from "egg";
|
|
4
|
+
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
* LogRotator plugin
|
|
9
|
+
*
|
|
10
|
+
* @since 4.1.0
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```ts
|
|
13
|
+
* // config/plugin.ts
|
|
14
|
+
* import logrotatorPlugin from '@eggjs/logrotator';
|
|
15
|
+
*
|
|
16
|
+
* export default {
|
|
17
|
+
* ...logrotatorPlugin(),
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
17
21
|
declare const _default: EggPluginFactory;
|
|
18
|
-
|
|
19
|
-
export
|
|
22
|
+
//#endregion
|
|
23
|
+
export { LogRotator, RotateFile, RotatorOptions, _default as default };
|