Bug #57690 impossible to redirect log-error to STDOUT in 5.1
Submitted: 24 Oct 2010 10:47 Modified: 19 Nov 2010 20:34
Reporter: Alex Efros Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.1.50 OS:Linux
Assigned to: CPU Architecture:Any
Tags: log-error, stdout

[24 Oct 2010 10:47] Alex Efros
Description:
In 5.0.90 and all previous versions it was possible to redirect log-error to STDOUT or STDERR using paths like /dev/stdout or /proc/self/fd/1. In 5.1.x it's impossible because mysqld_safe append ".err" to log-error value if it doesn't contain ".".

This probably affect all OS except Windows (where mysqld_safe has --console option according to doc).

Ability to log to STDOUT is important when using service supervisors like daemontools or runit and their loggers (like svlogd) to run mysql server.

How to repeat:
In /etc/mysql/my.cnf set:

[mysqld]
log-error = /dev/stdout

then restart mysql. Logs will be stored in /dev/stdout.err.

Suggested fix:
a) add windows-like --console option to *NIX versions of mysqld_safe
b) add special handling for log-error values pointing to files in directories /proc and /dev in mysqld_safe: don't append .err to such file names
[19 Nov 2010 20:34] Sveta Smirnova
Thank you for the report.

Verified as described, although there is perfect workaround:

ln -s /dev/stderr ./errorlog.err

Then start server with option log-error=./errorlog.err