Skip to content

Ensure the log destinations are set correctly

Description

PostgreSQL supports several methods for logging server messages, including stderr, csvlog and syslog.

Rationale

If log_destination is not set, then any log messages generated by the core PostgreSQL processes will be lost.

One or more supported destinations should be set for server log output.

Applies To

  • Databases

Tags

This rule is applied when the following tags are present:

Tag With Value
secureclouddb/provider aws
secureclouddb/service rds
secureclouddb/engine postgres

Default Rule

const { getServerSetting, isEmpty } = module
/**
 * @param {Object} databaseSettings - database settings object
 * @returns {boolean} true if any log destinations is set
 */

function validate(databaseSettings) {

    const settingName = 'log_destination'
    const actualValue = getServerSetting(databaseSettings, settingName)
    const success = !isEmpty(actualValue)

    return {
        success,
    }
}

// invoke
// ToDo add parameter support: list of log destinations supplied by the org
validate(databaseSettings);