=== modified file 'scripts/mysqld_safe.sh' --- scripts/mysqld_safe.sh 2013-09-21 03:10:54 +0000 +++ scripts/mysqld_safe.sh 2014-01-23 23:37:39 +0000 @@ -143,10 +143,18 @@ log_generic daemon.notice "$@" } +# Open and close the log file to output to the correct file during log rotation. +log_to_file() { + while read line + do + echo $line >> "`shell_quote_string "$err_log"`" + done +} + eval_log_error () { cmd="$1" case $logging in - file) cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" ;; + file) cmd="$cmd 2>&1 | log_to_file" ;; syslog) # mysqld often prefixes its messages with a timestamp, which is # redundant when logging to syslog (which adds its own timestamp)