Bug #63548 disable logging to slow log session-wise
Submitted: 2 Dec 2011 19:13 Modified: 2 Dec 2011 19:44
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:any OS:Any
Assigned to: CPU Architecture:Any
Tags: qc

[2 Dec 2011 19:13] Peter Laursen
Description:
Since http://bugs.mysql.com/bug.php?id=63542 was accepted only as a very minor documentation request I will have to post another report

Quote: 

Description:
There is a variable 'sql_log_off'http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_sql_log_off

"If set to 1, no logging is done to the general query log for this client."

How to repeat:
n/a

Suggested fix:
Quote continued:

Suggested fix:

I think it should also turn off logging to slow log (if it does not). A SUPER user may very well execute some queries (maintenance queries, ad-hoc
queries) that he knows very well in advance are slow (because indexes are not optimized for such queries - indexes are optimized for applications) and there is no reason to record it in the slow log in such case. It may actually cause unnecessary concern.

Alternatively a seperate variable for slow log could be provided, but I am generally not in favour of more options and variables.

Actually I find *protection from irrelevant garbage* more important for the slow log than for the general log. And if the reationale is that a *SUPER user should be allowed to hide* what he he is doing from people having access to
the logs, then it does not work fully if not writing to the slow log also gets disabled).

(I will not be surprised if this variable turns out to be older than the slow log in MySQL BTW!)
[2 Dec 2011 19:44] Valeriy Kravchuk
Thank you for the feature request. I think separate variable is needed for this.