From the MySQL command line client (or your prefered client), with a user that has privilige to do this command.
To turn it on:
mysql> set global general_log = 1;
To turn it off:
mysql> set global general_log = 0;