diff --git a/docker-compose.fd.yml b/docker-compose.fd.yml index 40e5198383..a62b0693de 100644 --- a/docker-compose.fd.yml +++ b/docker-compose.fd.yml @@ -47,6 +47,7 @@ services: volumes: - ./environments/ha:/opt/app-root/src/src/environment - ./services/backend/src:/opt/app-root/src/src + frontend: <<: *defaults build: @@ -124,6 +125,7 @@ services: SIS_IMPORTER_USER: dev SIS_NATS_TOKEN: dev SIS_NATS_URI: sis-updater-nats://sis-updater-nats:4222 + SERVICE_PROVIDER: fd ports: - 8082:8082 volumes: @@ -155,6 +157,7 @@ services: SIS_NATS_TOKEN: dev SIS_NATS_URI: sis-updater-nats://sis-updater-nats:4222 ROOT_ORG_ID: ${ROOT_ORG_ID} + SERVICE_PROVIDER: fd volumes: - ./updater/sis-updater-worker/:/opt/app-root/src diff --git a/services/backend/src/util/logger.js b/services/backend/src/util/logger.js index 03ef3091f5..cfef445e36 100644 --- a/services/backend/src/util/logger.js +++ b/services/backend/src/util/logger.js @@ -2,13 +2,13 @@ const os = require('os') const winston = require('winston') const { WinstonGelfTransporter } = require('winston-gelf-transporter') -const { isProduction } = require('../config') +const { isProduction, serviceProvider } = require('../config') const { colorize, combine, timestamp, printf } = winston.format const transports = [new winston.transports.Console()] -if (isProduction) { +if (isProduction && serviceProvider !== 'Fd') { transports.push( new WinstonGelfTransporter({ handleExceptions: true, diff --git a/updater/sis-updater-scheduler/src/config.js b/updater/sis-updater-scheduler/src/config.js index de171d51e8..75aa4e05f4 100644 --- a/updater/sis-updater-scheduler/src/config.js +++ b/updater/sis-updater-scheduler/src/config.js @@ -21,6 +21,7 @@ module.exports.SCHEDULE_IMMEDIATE = process.env.SCHEDULE_IMMEDIATE?.split(',') | module.exports.ENABLE_WORKER_REPORTING = module.exports.EXIT_AFTER_IMMEDIATES || process.env.ENABLE_WORKER_REPORTING === 'yes' module.exports.SLACK_WEBHOOK = process.env.SLACK_WEBHOOK +module.exports.serviceProvider = process.env.SERVICE_PROVIDER || '' // Sentry module.exports.sentryRelease = process.env.SENTRY_RELEASE || '' diff --git a/updater/sis-updater-scheduler/src/utils/logger.js b/updater/sis-updater-scheduler/src/utils/logger.js index e4cb2f19aa..7c922fca4d 100644 --- a/updater/sis-updater-scheduler/src/utils/logger.js +++ b/updater/sis-updater-scheduler/src/utils/logger.js @@ -11,6 +11,7 @@ const { sentryEnvironment, sentryDSN, runningInCI, + serviceProvider, } = require('../config') const { combine, timestamp, printf, splat } = winston.format @@ -64,7 +65,7 @@ if (isDev) { transports.push(new winston.transports.Console({ format: combine(splat(), timestamp(), prodFormat) })) - if (isProduction && !isStaging) { + if (isProduction && !isStaging && serviceProvider !== 'fd') { transports.push( new WinstonGelfTransporter({ handleExceptions: true, diff --git a/updater/sis-updater-worker/src/config.js b/updater/sis-updater-worker/src/config.js index e92c27ea8d..88b11ec45f 100644 --- a/updater/sis-updater-worker/src/config.js +++ b/updater/sis-updater-worker/src/config.js @@ -14,6 +14,7 @@ module.exports.REDIS_TOTAL_STUDENTS_DONE_KEY = 'TOTAL_STUDENTS_DONE' module.exports.REDIS_LATEST_MESSAGE_RECEIVED = 'LATEST_MESSAGE_RECEIVED' module.exports.REDIS_LAST_COMPLETED_SCHEDULE = 'LAST_COMPLETED_SCHEDULE' module.exports.rootOrgId = process.env.ROOT_ORG_ID || 'hy-university-root-id' +module.exports.serviceProvider = process.env.SERVICE_PROVIDER || '' // Sentry module.exports.sentryRelease = process.env.SENTRY_RELEASE || '' diff --git a/updater/sis-updater-worker/src/utils/logger.js b/updater/sis-updater-worker/src/utils/logger.js index 0d6e40cfce..0dda115641 100644 --- a/updater/sis-updater-worker/src/utils/logger.js +++ b/updater/sis-updater-worker/src/utils/logger.js @@ -11,6 +11,7 @@ const { sentryEnvironment, sentryDSN, runningInCI, + serviceProvider, } = require('../config') const { colorize, combine, timestamp, printf, uncolorize } = winston.format @@ -54,7 +55,7 @@ transports.push( }) ) -if (isProduction && !isStaging) { +if (isProduction && !isStaging && serviceProvider !== 'fd') { transports.push( new WinstonGelfTransporter({ handleExceptions: true,