Quantcast
Channel: MySQL Forums - NDB clusters
Viewing all articles
Browse latest Browse all 1562

Docker container logging to stderr (no replies)

$
0
0
I have struggled to convince mysqld to log to stderr so its logs can be captured by the Docker log driver...wanted to pass on my experiences.

Relevant bugs:
https://bugs.mysql.com/bug.php?id=57690
https://bugs.mysql.com/bug.php?id=83060

I finally got this to work with the following:
ln -sf /dev/stderr /var/log/mysql/log.err
chown mysql:mysql /var/log/mysql/log.err

and invoke mysqld with:
mysqld --log-error=/var/log/mysql/log.err

The odd thing is that putting the symbolic link creation and chown into a Dockerfile to build a custom image did NOT work. I could only get it to work by writing my own entrypoint script, setting up & chown the link, and then proceed to run the existing entrypoint script, like this:

#!/bin/bash

ln -sf /dev/stderr /var/log/mysql/log.err
chown mysql:mysql /var/log/mysql/log.err

# Hand off to the original script
set -- /entrypoint.sh "$@"
exec "$@"

Hope this is helpful for someone.

Viewing all articles
Browse latest Browse all 1562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>