1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

limit the size and number of log files, rotate automatically

Signed-off-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
Sebastian Malton 2020-08-31 14:05:21 -04:00
parent 862b597a75
commit b578ce895e

View File

@ -1,3 +1,4 @@
import { app } from "electron";
import winston from "winston"
import { isDebugging } from "../common/vars";
@ -10,7 +11,10 @@ const fileOptions: winston.transports.FileTransportOptions = {
handleExceptions: false,
level: isDebugging ? "debug" : "info",
filename: "lens.log",
dirname: __dirname,
dirname: app.getPath("logs"),
maxsize: 16 * 1024,
maxFiles: 16,
tailable: true,
}
const logger = winston.createLogger({