import { resolve } from 'path';

const APP_LOG_PATH = resolve(__dirname, '..', '.logs', 'server.log');
const ACCESS_LOG_PATH = resolve(__dirname, '..', '.logs', 'access.log');

export default {
  loggerConfig: {
    DEFAULT_META: {
      serviceName: process.env.SERVICE_ID || 'Monotype- Research360',
    },
    APP: {
      APP_LOG_DESTINATION: process.env.APP_LOG_DESTINATION || 'STDOUT',
      APP_LOG_PATH: process.env.APP_LOG_PATH || APP_LOG_PATH,
      LOG_LEVEL: process.env.LOG_LEVEL || 'info',
      LOGS_PRETTY_PRINT: process.env.LOGS_PRETTY_PRINT === 'true', // DEFAULT: FALSE
      DEFAULT_META: {
        serviceName: process.env.SERVICE_ID || 'GM',
      },
      DISABLED: process.env.APP_LOGS_DISABLED === 'true',
    },
    ACCESS: {
      ACCESS_LOG_DESTINATION: process.env.ACCESS_LOG_DESTINATION || 'FILE',
      ACCESS_LOG_PATH: process.env.ACCESS_LOG_PATH || ACCESS_LOG_PATH,
      //DEFAULT_META: defer((cfg) => cfg.logger.DEFAULT_META),
      DISABLED: process.env.ACCESS_LOGS_DISABLED === 'true',
    },
  },
};
