"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "createFileLoggingTransport", {
    enumerable: true,
    get: function() {
        return createFileLoggingTransport;
    }
});
const _luxon = require("luxon");
const _path = require("path");
const _fsutils = require("../../utils/fs.utils");
const _serverconstants = require("../../server.constants");
const _winston = /*#__PURE__*/ _interop_require_default(require("winston"));
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
function createFileLoggingTransport(options) {
    if (!options.enabled) {
        return;
    }
    const date = _luxon.DateTime.now().toISODate();
    const logFilePath = (0, _path.join)((0, _fsutils.superRootPath)(), _serverconstants.AppConstants.defaultLogsFolder, `${_serverconstants.AppConstants.logAppName}-${date}.log`);
    return new _winston.default.transports.File({
        level: options.isTest ? "warn" : "info",
        filename: logFilePath,
        maxsize: 5000000,
        maxFiles: 5
    });
}

//# sourceMappingURL=file-logging.transport.js.map