• Get the basic configuration definitions that are used for most mosaic services

    Parameters

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

      process.env variables or custom provided values

    • Optional logger: LoggerFn

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

    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: (() => "test" | "development" | "production")
        • (): "test" | "development" | "production"
        • Returns "test" | "development" | "production"

          Example

          NODE_ENV=development
          
    • fullDevLogs: (() => boolean)
        • (): boolean
        • Returns boolean

          Example

          FULL_DEV_LOGS=true
          
    • healthEndpointPort: (() => number)
        • (): number
        • Returns number

          Example

          HEALTH_ENDPOINT_PORT=9000
          
    • isDev: (() => boolean)
        • (): boolean
        • Returns boolean

          Example

          NODE_ENV=development
          
    • isProd: (() => boolean)
        • (): boolean
        • Returns boolean

          Example

          NODE_ENV=production
          
    • logLevel: (() => "" | "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE")
        • (): "" | "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE"
        • Returns "" | "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE"

          Example

          LOG_LEVEL=INFO
          
    • logMaskKeywords: (() => string[])
        • (): string[]
        • Returns string[]

          Example

          LOG_MASK_KEYWORDS=secret,password,connectionString
          
    • logMaskMaxDepth: (() => number)
        • (): number
        • Returns number

          Example

          LOG_MASK_MAX_DEPTH=10
          
    • secureLoggingMode: (() => MaskMode)
        • (): MaskMode
        • Returns MaskMode

          Example

          SECURE_LOGGING_MODE=UNSAFE_DEBUG_UNSAFE
          
    • serviceId: (() => string)
        • (): string
        • Returns string

          Example

          SERVICE_ID=my-business-service
          

Generated using TypeDoc