I found that logging will not be possible even if my.cnf configuration is correct, so you can also try re-creating your log folder.
This may not be necessary if the logs are in an odd state. (In my case, I just stopped logging into my.cnf and then turned it back on, but nothing happened, probably because the existing files were not the latest updates?).
Something like this should work:
sudo service mysql stop sudo mv /var/log/mysql /tmp/mysqlold
Mandatory warning: Obviously, you should be careful when deleting anything on the database server. This will destroy / upset / ruin any replication using this database as the master (although you can resume replication as a slave). However, I believe that this should be safe, as it does not delete the database itself.
source share