Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35313

Setting log-basename overrides slow_query_log_file

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 11.1.1
    • N/A
    • N/A
    • 11.1.1-MariaDB-log MariaDB Server
      NAME="Rocky Linux"
      VERSION="8.10 (Green Obsidian)"

    Description

      Description:
      Users are confused by the undocumented interaction of `log-basename` with other log file definition variables.

      Reproduction:

      sudo su
      curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup |  bash -s -- --mariadb-server-version=mariadb-11.1.1
      yum install MariaDB-server
      systemctl start mariadb
      echo "
       
      [mariadb]
      log_slow_query_time = 1
      log_slow_query = 1
      log_slow_query_file = /var/log/mariadb/slow-queries.log" >> /etc/my.cnf.d/server.cnf
       
      mkdir /var/log/mariadb
      chown mysql:mysql /var/log/mariadb
      systemctl restart mariadb
      # works as expected
      mariadb -e "SELECT SLEEP(5);"
      cat /var/log/mariadb/slow-queries.log
       
      # does not work as expected. /var/log/mariadb/slow-queries.log isnt used anymore now
      echo "log-basename=any-prefix" >> /etc/my.cnf.d/server.cnf
      systemctl restart mariadb
      mariadb -e "SELECT SLEEP(4);"
      cat /var/log/mariadb/slow-queries.log
      # instead its using /var/lib/mysql/any-prefix-slow.log
      cat /var/lib/mysql/any-prefix-slow.log
      

      Workaround:
      set log-basename before slow_query_log_file or log_slow_query_file
      Example:

      [mariadb]
      log-basename=any-prefix
      log_slow_query_time = 1
      slow_query_log = 1
      slow_query_log_file = /var/log/mariadb/slow-queries.log
      

      Attachments

        Issue Links

          Activity

            People

              julien.fritsch Julien Fritsch
              allen.herrera Allen Herrera
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.