Set logging levels#

Set the severity level of logged event messages logged for Elasticsearch and PostgreSQL.

About logging levels#

As of release 2.8.0, the default logging level for bundled instances of Elasticsearch and PostgreSQL events is ERROR, or their respective equivalents.

Setting more verbose logging levels such as INFO or WARNING can cause significantly higher resource usage on your systems.

Elasticsearch logging levels#

Elasticsearch relies on Log4j for logging. You can configure the following logging levels for Elasticsearch:

Available logging levels:

  • TRACE

  • DEBUG

  • INFO

  • WARN

  • ERROR

  • All

  • OFF

Change the logging level dynamically#

To temporarily and dynamically change the logging level for Elasticsearch:

  1. Open the Kibana Dev Tools Console. In your web browser, go to https://${platform_host_name}/private/kibana/app/dev_tools#/console.

    For example, https://eclecticiq.platform.org/private/kibana/app/dev_tools#/console

  2. Using the Dev Tools Console, send the following PUT request:

    # Raise the logging severity from ERROR to DEBUG
    PUT /_cluster/settings
    {
      "transient": {
        "logger._root": "DEBUG"
      }
    }
    

    The Console should display a response that looks like this:

    {
      "acknowledged": true,
      "persistent": {},
      "transient": {
        "logger": {
          "_root": "DEBUG"
        }
      }
    }
    

Change the logging level permanently#

To permanently change the logging level for Elasticsearch:

  1. Edit log4j2.properties as root:

    vi /etc/eclecticiq-elasticsearch/log4j2.properties
    
  2. In the log4j2.properties file, browse to the rootLogger.level parameter, and then assign it the new logging level:

    // Raise the logging severity from 'error' to 'debug'
    rootLogger.level = debug
    
  3. Save log4j2.properties, and exit the text editor.

  4. Restart the Elasticsearch service. Run as root:

PostgreSQL logging levels#

You can configure the logging levels for PostgreSQL from INFO to PANIC.

Change the logging level permanently#

To permanently change the logging level for PostgreSQL:

  1. Edit eclecticiq-postgres.conf as root:

    vi /etc/eclecticiq-postgres/eclecticiq-postgres.conf
    
  2. In the eclecticiq-postgres.conf file, browse to the following parameters, and then assign them new values for the logging level:

    // Lower the logging severity from ERROR to WARNING
    // Set log verbosity to DEFAULT (medium; min verbosity: TERSE; max verbosity: VERBOSE)
    log_min_messages = 'WARNING'
    log_min_error_statement = 'ERROR'
    log_error_verbosity = 'DEFAULT'
    
  3. Save eclecticiq-postgres.conf, and exit the text editor.

  4. Restart the PostgreSQL service. Run as root:

    systemctl restart postgresql-11