Axinom Mosaic Libraries
    Preparing search index...
    • Get the basic configuration definitions that are used for most mosaic services

      Parameters

      • variables: Dict<string | undefined> = process.env

        process.env variables or custom provided values

      • Optionallogger: LoggerFn

      Returns {
          environment: () => "development" | "production" | "test";
          fullDevLogs: () => boolean;
          healthEndpointPort: () => number;
          isDev: () => boolean;
          isProd: () => boolean;
          logLevel: () => | ""
          | "FATAL"
          | "ERROR"
          | "WARN"
          | "INFO"
          | "DEBUG"
          | "TRACE";
          logMaskKeywords: () => string[];
          logMaskMaxDepth: () => number;
          secureLoggingMode: () => MaskMode;
          serviceId: () => string;
          useEphemeralPortsDuringDev: () => boolean;
      }

      The following configuration values are included:

      environment // e.g. NODE_ENV=development
      serviceId // e.g. SERVICE_ID=my-business-service
      logLevel // e.g. LOG_LEVEL=INFO
      healthEndpointPort // e.g. HEALTH_ENDPOINT_PORT=9000
      secureLoggingMode // e.g. SECURE_LOGGING_MODE=UNSAFE_SECRETS_NOT_HIDDEN_UNSAFE
      logMaskKeywords // e.g. LOG_MASK_KEYWORDS=secret,password,connectionString
      logMaskMaxDepth // e.g. LOG_MASK_MAX_DEPTH=10
      fullDevLogs // e.g. FULL_DEV_LOGS=true
      isDev // true for NODE_ENV=development
      isProd // true for NODE_ENV=production
      • environment: () => "development" | "production" | "test"
        NODE_ENV=development
        
      • fullDevLogs: () => boolean
        FULL_DEV_LOGS=true
        
      • healthEndpointPort: () => number
        HEALTH_ENDPOINT_PORT=9000
        
      • isDev: () => boolean
        NODE_ENV=development
        
      • isProd: () => boolean
        NODE_ENV=production
        
      • logLevel: () => "" | "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE"
        LOG_LEVEL=INFO
        
      • logMaskKeywords: () => string[]
        LOG_MASK_KEYWORDS=secret,password,connectionString
        
      • logMaskMaxDepth: () => number
        LOG_MASK_MAX_DEPTH=10
        
      • secureLoggingMode: () => MaskMode
        SECURE_LOGGING_MODE=UNSAFE_DEBUG_UNSAFE
        
      • serviceId: () => string
        SERVICE_ID=my-business-service
        
      • useEphemeralPortsDuringDev: () => boolean

        This is used to determine if the service should use ephemeral ports for general endpoints during development. This is useful to avoid port conflicts when running multiple services having the same general port number (i.e. liveness/readiness, maintenance, monitoring, etc.).

        However if running services in a container, this should be set to false, as the container isolates the ports for each service.

        NOTE: this is effective only when the service is running in development mode (i.e. NODE_ENV=development).

        USE_EPHEMERAL_PORTS_DURING_DEV=true