Bug #40857 Log debug information in retrospect when an error condition is hit
Submitted: 19 Nov 2008 14:41
Reporter: Kay Roepke Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S4 (Feature request)
Version:2.0 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: logging

[19 Nov 2008 14:41] Kay Roepke
Description:
When the agent/proxy is run on a production-suitable log level (often critical) it can be hard to see the root cause of a certain failure.
Most likely helpful information can be obtained from lower-level log messages which are not visible on the set log level, but that information is not accessible without a restart, and worse, it's sometimes impossible to recreate the failure condition.

How to repeat:
Track down a hard problem with the default log level ;)

Suggested fix:
Optionally save debug log information in a ringbuffer instead of discarding it.
Then when a critical message is logged, dump the entire output of the backlog buffer to the log file (or syslog) to aid troubleshooting.
This combines the best of two worlds: Normally the log file is empty as long as no error conditions are hit, but when one is encountered the file contains (hopefully) useful information, not only "something has gone terribly wrong".
The overhead should be neglible as long as we don't allow the buffer to grow too large (this can be implemented as both a byte-sized and a number of messages limit).