Why does MySQL not write the log file?

I wanted to switch on the query log of MySQL. So I added the following to /etc/my.cnf

log = /var/log/mysql.log

and restarted the server: sudo /etc/init.d/mysql restart, but no log file occured even if I executed some queries.

The Problem was that mysql had no rights for /var/log. So the solution was to create an own directory for mysql

cd /var/log
sudo mkdir mysql
sudo chown mysql:mysql mysql/

and log into it:

log = /var/log/mysql/mysql.log