reynierpm at gmail.com
2015-Nov-30 21:57 UTC
[CentOS] SOT: MariaDB 5.5.x-MariaDB logs are not going to desired .log file
Hi there, I know this is off-topic or semi off-topic but I really need some help since I am stucked. I'm trying to redirect MariaDB logs to `/var/log/mysql/*.log` files as shown below on the `/etc/my.cnf.d/server.cnf` file: # # These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # # See the examples of server my.cnf files in /usr/share/mysql/ # # this is read by the standalone daemon and embedded servers [server] # this is only for the mysqld standalone daemon [mysqld] #wait_timeout=28800 #interactive_timeout = 28800 max_allowed_packet=512M #General Query Log general_log_file = /var/log/mysql/mysql_query.log general_log = 1 #Error Log log_error = /var/log/mysql/mysql_error.log #Slow Query Log slow_query_log = 1 slow_query_log_file = /var/log/mysql/mysql_slow.log long_query_time = 2 log-queries-not-using-indexes collation-server = utf8_general_ci init-connect='SET NAMES utf8' character-set-server = utf8 # this is only for embedded server [embedded] # This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadb] # This group is only read by MariaDB-10.0 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-5.5] `mysql_query.log`, `mysql_error.log` and `mysql_slow.log` should go to `/var/log/mysql/`, right? For some reason, unknow to me, they are not going. I did run the following query: MariaDB [(none)]> show variables like '%log%'; And this is the output: +-------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | Variable_name | Value | +-------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | aria_checkpoint_log_activity | 1048576 | | aria_log_file_size | 1073741824 | | aria_log_purge_type | immediate | | aria_sync_log_dir | NEWFILE | | back_log | 50 | | binlog_annotate_row_events | OFF | | binlog_cache_size | 32768 | | binlog_checksum | NONE | | binlog_direct_non_transactional_updates | OFF | | binlog_format | STATEMENT | | binlog_optimize_thread_scheduling | ON | | binlog_stmt_cache_size | 32768 | | expire_logs_days | 0 | | general_log | OFF | | general_log_file | pdone-prod.log | | innodb_flush_log_at_trx_commit | 1 | | innodb_locks_unsafe_for_binlog | OFF | | innodb_log_block_size | 512 | | innodb_log_buffer_size | 8388608 | | innodb_log_file_size | 5242880 | | innodb_log_files_in_group | 2 | | innodb_log_group_home_dir | ./ | | innodb_mirrored_log_groups | 1 | | innodb_recovery_update_relay_log | OFF | | innodb_use_global_flush_log_at_trx_commit | ON | | log | OFF | | log_bin | OFF | | log_bin_trust_function_creators | OFF | | log_error | /var/lib/mysql/pdone-prod.pdi-inc.com.err | | log_output | FILE | | log_queries_not_using_indexes | OFF | | log_slave_updates | OFF | | log_slow_filter | admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk | | log_slow_queries | OFF | | log_slow_rate_limit | 1 | | log_slow_verbosity | | | log_warnings | 1 | | max_binlog_cache_size | 18446744073709547520 | | max_binlog_size | 1073741824 | | max_binlog_stmt_cache_size | 18446744073709547520 | | max_relay_log_size | 0 | | relay_log | | | relay_log_index | | | relay_log_info_file | relay-log.info | | relay_log_purge | ON | | relay_log_recovery | OFF | | relay_log_space_limit | 0 | | slow_query_log | OFF | | slow_query_log_file | pdone-prod-slow.log | | sql_log_bin | ON | | sql_log_off | OFF | | sync_binlog | 0 | | sync_relay_log | 0 | | sync_relay_log_info | 0 | +-------------------------------------------+--------------------------------------------------------------------------------------------------------------+ 54 rows in set (0.01 sec) I have tried putting same config at `[mariadb]` and `[mariadb-5.5]` and result is the same. Why changes are not working? I have restarted MariaDB (mysql) service several times and even I have restarted the whole server. Seems like MariaDB is not reading those values, any advice?
Wes James
2015-Nov-30 22:50 UTC
[CentOS] SOT: MariaDB 5.5.x-MariaDB logs are not going to desired .log file
> On Nov 30, 2015, at 2:57 PM, reynierpm at gmail.com wrote: > > Hi there, I know this is off-topic or semi off-topic but I really need some > help since I am stucked. > > I'm trying to redirect MariaDB logs to `/var/log/mysql/*.log` files as > shown below on the `/etc/my.cnf.d/server.cnf` file:<snip> Does this help: http://dba.stackexchange.com/questions/98732/how-to-enable-queries-logs-in-mariadb <http://dba.stackexchange.com/questions/98732/how-to-enable-queries-logs-in-mariadb> did search online - maybe you need to change mysql log location that might override mariadb conf file. -wes
reynierpm at gmail.com
2015-Nov-30 23:15 UTC
[CentOS] SOT: MariaDB 5.5.x-MariaDB logs are not going to desired .log file
On Mon, Nov 30, 2015 at 5:50 PM, Wes James <comptekki at me.com> wrote:> Does this help: > > > http://dba.stackexchange.com/questions/98732/how-to-enable-queries-logs-in-mariadb > < > http://dba.stackexchange.com/questions/98732/how-to-enable-queries-logs-in-mariadb > > > > did search online - maybe you need to change mysql log location that might > override mariadb conf file. >Lol, that belongs to me I have updated that post to see if I can get some help, thanks for remember me that old post from past April
Reasonably Related Threads
- SOT: MariaDB 5.5.x-MariaDB logs are not going to desired .log file
- SOT: MariaDB 5.5.x-MariaDB logs are not going to desired .log file
- SOT: Best strategy for automatize a flow that need user interaction
- Re: Write content to file from Dockerfile and/or any other method
- Write content to file from Dockerfile and/or any other method