Logbestanden (MySQL)

Uit De Vliegende Brigade
Ga naar: navigatie, zoeken

MySQL kent verscheidene logbestanden. Bijbehorende zijn geconfigureerd in /etc/mysql/my.cnf:

# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id     = 1
#log_bin       = /var/log/mysql/mysql-bin.log
expire_logs_days  = 10
max_binlog_size         = 100M
#binlog_do_db     = include_database_name
#binlog_ignore_db = include_database_name

Nadere specificaties omtrent error_log, staan in /etc/mysql/conf.d/mysqld_safe_syslog.cnf. De inhoud van dat bestand:

[mysqld_safe]
syslog

En dit geeft aan dat logregels naar het systeemlog worden geschreven.

In ieder geval één keer heb ik meegemaakt dat error log-entries wel degelijk naar het bestand werden geschreven dat gespecificeerd stond in my.cnf: /var/log/mysql/error.log.

Bronnen