strapi/packages/utils/logger/lib/configs/output-file-configuration.js
2023-01-24 10:59:45 +01:00

21 lines
553 B
JavaScript

'use strict';
const { transports } = require('winston');
const { LEVEL_LABEL, LEVELS } = require('../constants');
const { prettyPrint } = require('../formats');
const excludeColors = require('../formats/exclude-colors');
const createOutputFileConfiguration = (filename) => {
return {
level: LEVEL_LABEL,
levels: LEVELS,
format: prettyPrint(),
transports: [
new transports.Console(),
new transports.File({ level: 'error', filename, format: excludeColors }),
],
};
};
module.exports = createOutputFileConfiguration;