import { getHomeDir } from "./env";
const log4js = require("log4js");
const path = require("path");

const MAX_SIZE = 10 * 1024 * 1024;

const logDir = getHomeDir("logs");
const logsFilePath = path.join(logDir, "scan.log");

log4js.configure({
  appenders: {
    scan: {
      type: "file",
      filename: logsFilePath,
      maxLogSize: MAX_SIZE
    }
  },
  categories: { default: { appenders: ["scan"], level: "debug" } }
});

export default log4js;
