Bug #75027 Maximum (debug) logging level doesn't log connections, queries or backend used
Submitted: 27 Nov 2014 16:54 Modified: 16 Dec 2014 18:15
Reporter: Lloyd Richard Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Proxy: Core Severity:S4 (Feature request)
Version:0.8.5 alpha OS:Linux
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request)

[27 Nov 2014 16:54] Lloyd Richard
Description:
If I use the maximum logging level of debug with MySQL Proxy by starting it with the --log-level=debug option, it simply isn't verbose enough. It doesn't include information about client connections (e.g. their IP), which backend the client connection was sent to or anything about the actual query.

How to repeat:
Start up MySQL Proxy with --log-level=debug and a couple of backends. Stop one of the backends and see how little info you get when MySQL Proxy reports a connection issue to the stopped backend:

2014-11-27 16:03:56: (message) proxy-plugin.c.1756: connect(<BACKEND_IP>:3307) failed: Connection refused. Retrying with different backend.

That's literally it. We don't know the client connection IP, what the query was or which different backend was selected for the retry (or indeed if that retry worked...a guess the lack of a second error line might suggest it worked).

Suggested fix:
To be clear, I don't just want maximum logging to only include warning/errors about connections, but I want to know info about successful connections as well.

In other words, I'd like the log to include the date/time, client IP, query (if possible) and which backend it went to - this should be logged for *every* connection (successful or not) at debug level.

As it stands, this major deficiency is being filled with a fair number of homebrew LUA scripts out there, which need to be hand-installed and MySQL Proxy config changed to pick them up, which isn't ideal.

Introduce some new level like "verbosedebug" or something for the suggested logging if you want to keep "debug" level as quiet as it currently is.
[16 Dec 2014 18:15] Sveta Smirnova
Thank you for the reasonable feature request.