Having to deal with many MySQL issues lately, I found it hard to look at the container logs due to the following error.
❯ docker logs 01a31fd0ca8e
2024-01-25 19:21:23+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.6+maria~ubu2204 started.
2024-01-25 19:21:23+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-01-25 19:21:23+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.6+maria~ubu2204 started.
2024-01-25 19:21:23+00:00 [Note] [Entrypoint]: Initializing database files
error from daemon in stream: Error grabbing logs: invalid character 'l' after object key:value pair
I found this thread, which confirms it's an issue but has no solution https://forums.docker.com/t/docker-container-error-grabbing-logs/138475/5
I was then thinking about defining log-error in /var/local/enhance/mysql/conf.d/enhance.cnf
log-error = /var/lib/mysql/mysql.log
This then drops mysql errors into /var/local/enhance/mysqlcd-data/data/mysql.log
which is great. However it needs to be logrotated.
I think it would be beneficial for mysql logs to be available by default with Enhance in /var/log/mysql.log and logrotated.