Bug #2588 Allow filtering of messages logged (general query log)
Submitted: 30 Jan 2004 12:49 Modified: 28 Nov 2005 9:44
Reporter: [ name withheld ] Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version:any OS:Any (any)
Assigned to: CPU Architecture:Any

[30 Jan 2004 12:49] [ name withheld ]
I was wondering if it could be added to a wish list - I would like to be
able to selectively log stuff to the general query log.  The reason for
wanting to be able to filter the entries is because the amount of activity
that goes on through my MySQL servers (I have several that run for a large
web hosting company) is so much that I would quickly run out of available
disk space if I turned on logging.

I need logging to some degree as I want to at *least* track user logins and
connections.  I don't care as much about the queries they run (although it
would be nice to see if users try to use certain commands like GRANT or
something), but being able to at least log their connections is really a
bare necessity in case a user decides they're going to try something evil ;P

I don't know if you can (yet) set the log= variable settings within
configuration files yet, but that would also be nice, and would probably
make sense if this feature request is ever added since there would need to
be somewhere to specify long lines of things to log or not to log (using +
and - to turn on/off certain events, etc...).

It might also (if feasable) be nice to have the option to log some stuff to

I'm not sure if this has yet been requested, but I didn't turn anything up
checking all of the changelogs for everything since 4.0 to the latest 5.x.  I have posted this in the internals mailing list already.


How to repeat:
feature request - rinse and repeat as necessary

Suggested fix:
I was told that it had been requested that log entries actually be searchable via MySQL itself, and although that does sound like a very neat idea, it still means that everything would need to be logged and could take up considerable disk space (unless a binary format for this info was used?).  It might be nice to have both these features implemented so we could pick what info is logged and what is completely discarded.

On a side note, I would really like to not lose the feature of logging info to a log file, as it is very useful for quickly checking and tail(ing) the logs.
[28 Nov 2005 9:44] Valeriy Kravchuk
Thank you for a useful feature request. Although, selective logging of specific SQL statements or statements from specific users only is usually refered to as "Audit", som separate audit log may be also created for that.