title: Where does the mariadb logs exists
body: <p>I am using mariadb and I to investigate some issue I wanted to check the logs. To my surprise, log file is not generated for mariadb.</p>
  
  <p>I suspect this cannot be the case so I am doubting my search skills. </p>
  
  <pre><code>MariaDB [(none)]&gt; show variables like 'log_error'
      -&gt; ;
  +---------------+-------+
  | Variable_name | Value |
  +---------------+-------+
  | log_error     |       |
  +---------------+-------+
  1 row in set (0.00 sec)
  </code></pre>
  
  <p>I have added the entry in my.cnf still above field is coming to be empty.</p>
  
  <pre><code>[root@cslcodev11-oem ~]# cat /etc/my.cnf
  [mysqld]
  !includedir /etc/mysqld/conf.d
  datadir=/mnt/mgmt/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  tmpdir=/mnt/mgmt/var/lib/mysql_tmp
  user=mysql
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  ### TRT-3229 #####
  sync_binlog=1
  innodb_flush_method=O_DIRECT
  innodb_support_xa = 1
  myisam_repair_threads = 2
  myisam_recover_options = FORCE
  ###################
  innodb_file_per_table=1
  innodb_log_buffer_size = 8M
  table_open_cache=256
  max_heap_table_size=256M
  ### TRT-4685 ###
  max_connections=500
  ################
  innodb_log_file_size = 512M
  
  [mysqld_safe]
  log-error=/var/log/mariadb/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  [root@cslcodev11-oem ~]# 
  </code></pre>
  
  <p>So, I want to know do we have any default location where these logs are getting generated, if the path cannot be read from config files.</p>
  
  <h2>Update:</h2>
  
  <p>After some investigation, I found this information,</p>
  
  <p><em>Reference: <a href="https://mariadb.com/kb/en/mariadb/error-log/" rel="nofollow noreferrer">https://mariadb.com/kb/en/mariadb/error-log/</a></em></p>
  
  <hr>
  
  <p><strong>Activating the Error Log</strong></p>
  
  <p>The error log is active by default. The log-error=filename option determines where the output will be written. If no file name is specified, the log will be written to host-name.err. If no absolute path is specified, the file will be written to the data directory (determined by the value of the datadir system variable).</p>
  
  <p><em>On Unix systems, if the --log-error option is not used, the errors are written to stderr (usually, the command line).</em></p>
  
  <p><em>On Windows, if the --console option is specified, and --log-error is not used, the errors are written to the console. If --log-error is present, --console is ignored.</em></p>
  
  <p>So now I understand that due to some reason the configuration <strong>log_error</strong> in my.cnf is not considered.  So as per the suggestion, on Unix system, if --log-error is not used, logs are redirected to stdout.</p>
  
  <hr>
  
  <p>BUT, I am starting the service using <code>service mysqld start</code> command so I want to know what all options are used by default when we start the service using <code>service mysql start</code>? ESP, is --log-error used?</p>